- Newest
- Most votes
- Most comments
Hi there -
For sharing the output of one action with another action in the same workflow, you can define an artifact and use it as an input in additional actions.
File caching is used to cache data between multiple workflow runs, so I don't think this is the right capability for what you're trying to accomplish based on your description.
I hope that this helps!
Thanks @JonJ-AWS, artifacts were the answer and all working now :)
For anyone interested, sharing the workflow below:
---
Name: Initial_workflow
SchemaVersion: "1.0"
Triggers:
- Type: Push
Actions:
Build_Phase:
Identifier: aws/build@v1
Inputs:
Sources:
- WorkflowSource
Outputs:
AutoDiscoverReports:
Enabled: true
ReportNamePrefix: rpt
Artifacts:
- Name: pythonLibs
Files:
- /root/.local/**/*
Configuration:
Steps:
- Run: |-
echo "Install required environment libraries on ${HOSTNAME}"
pip install --user -r env_requirements.txt
- Run: |-
echo "Install required code libraries"
cd src
pip install --user -r requirements.txt
Compute:
Type: EC2
Test_Phase:
Identifier: aws/managed-test@v1
Inputs:
Sources:
- WorkflowSource
Artifacts:
- pythonLibs
Outputs:
AutoDiscoverReports:
Enabled: true
ReportNamePrefix: rpt
Configuration:
Steps:
- Run: |
echo "Copying artifacts from build on ${HOSTNAME}"
mv ${CATALYST_SOURCE_DIR_pythonLibs}/root/.local ~
export PATH=$PATH:$HOME/.local/bin
- Run: |
echo "Running Bandit security scan"
cd src
mkdir junit
bandit -r . -o junit/bandit.xml -f xml
- Run: |
echo "Running unit tests"
python -m pytest
Compute:
Type: EC2
DependsOn:
- Build_Phase
RE: "Am I right in understanding that different steps run in different containers?"
I will assume that you are referring to different actions (e.g. "Build_Phase" and "Test_Phase").
If that's correct then yes, they run in different containers.
RE: "Is it possible to use the same container [to run both actions]?"
This isn't supported today. If this experience is preferable, we'd know to know that and your reasoning :)
Relevant content
- asked 5 months ago
- asked a year ago
- asked a year ago
- asked 3 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 3 years ago
Great, glad to help!