Working with sources
A source, also called an input source, is a source repository that a workflow action needs access to in order to carry out its tasks. For example, a workflow action might need to access a source to obtain unit tests and run them against your application source files.
CodeCatalyst workflows support the following sources:
-
CodeCatalyst source repositories – For more information, see Source repositories in CodeCatalyst.
-
GitHub source repositories – For more information, see Using GitHub repositories in CodeCatalyst.
Topics
Specifying the source that will store the workflow definition file
Use the following instructions to specify the CodeCatalyst source repository where you want to store your workflow definition file. If you'd rather specify a GitHub source repository, see instead Using GitHub repositories in CodeCatalyst.
The source repository where your workflow definition file resides is identified by the
label, WorkflowSource
.
Note
You specify the source repository where your workflow definition file resides when you first commit your workflow definition file. After this commit, the repository and workflow definition file are linked together permanently. The only way to change the repository after the initial commit is to re-create the workflow in a different repository.
To specify the source repository that will store the workflow definition file
Open the CodeCatalyst console at https://codecatalyst.aws/
. -
Choose your project.
-
In the navigation pane, choose CI/CD, and then choose Workflows.
-
Choose Create workflow and create the workflow. For more information, see To create a workflow using the visual editor.
During the workflow creation process, you are asked to specify the CodeCatalyst repository where you want to store your workflow definition file.
Specifying the source that a workflow action will use
Use the following instructions to specify a source repository to use with a workflow action. On startup, the action bundles the files at the configured source repository into an artifact, downloads the artifact to the runtime environment Docker image where the action is running, and then completes its processing using the downloaded files.
Note
Currently, within a workflow action, you can only specify one source repository,
which is the source repository where the workflow definition file resides (in the
.codecatalyst/workflows/
directory). This source
repository is represented by the label WorkflowSource
.
Referencing files in a source repository
If you have files that reside in a source repository, and you need to refer to these files in one of your workflow actions, complete the following procedure.
Note
See also Referencing files in an artifact.
To reference a file in a source repository
-
In the action where you want to reference a file, add code similar to the following:
Actions: My-action: Inputs: Sources: - WorkflowSource Configuration: Steps: - run: cd my-app && cat file1.jar
In the previous code, the action looks in the
my-app
directory in the root of theWorkflowSource
source repository to find and display thefile1.jar
file.
Variables produced by the source
When a workflow runs, its source produces variables which you can use in subsequent workflow actions. For details, see WorkflowSource output variables in the Workflow output variable reference.