Defining an output artifact
Use the following instructions to define an artifact that you want an Amazon CodeCatalyst action to output. This artifact then becomes available for other actions to use.
Note
Not all actions support output artifacts. To determine whether your action supports them, run through the visual editor instructions that follow, and see if the action includes an Output artifacts button on the Outputs tab. If yes, output artifacts are supported.
- Visual
-
To define an output artifact using the visual editor
Open the CodeCatalyst console at https://codecatalyst.aws/
. -
Choose your project.
-
In the navigation pane, choose CI/CD, and then choose Workflows.
-
Choose the name of your workflow. You can filter by the source repository or branch name where the workflow is defined, or filter by workflow name or status.
-
Choose Edit.
-
Choose Visual.
-
In the workflow diagram, choose the action that will produce the artifact.
-
Choose the Outputs tab.
-
Under Artifacts, choose Add artifact.
-
Choose Add artifact, and enter information into the fields, as follows.
Build artifact name
Specify the name of an artifact generated by the action. Artifact names must be unique within a workflow, and are limited to alphanumeric characters (a-z, A-Z, 0-9) and underscores (_). Spaces, hyphens (-), and other special characters are not allowed. You cannot use quotation marks to enable spaces, hyphens, and other special characters in output artifact names.
For more information about artifacts, including examples, see Sharing artifacts and files between actions.
Files produced by build
Specify the files that CodeCatalyst includes in the artifact that is output by the action. These files are generated by the workflow action when it runs, and are also available in your source repository. File paths can reside in a source repository or an artifact from a previous action, and are relative to the source repository or artifact root. You can use glob patterns to specify paths. Examples:
-
To specify a single file that is in the root of your build location or source repository location, use
my-file.jar
. -
To specify a single file in a subdirectory, use
directory/my-file.jar
ordirectory/subdirectory/my-file.jar
. -
To specify all files, use
"**/*"
. The**
glob pattern indicates to match any number of subdirectories. -
To specify all files and directories in a directory named
directory
, use"directory/**/*"
. The**
glob pattern indicates to match any number of subdirectories. -
To specify all files in a directory named
directory
, but not any of its subdirectories, use"directory/*"
.
Note
If your file path includes one or more asterisks (
*
) or other special character, enclose the path with double quotation marks (""
). For more information about special characters, see Syntax guidelines and conventions.For more information about artifacts, including examples, see Sharing artifacts and files between actions.
Note
You may need to add a prefix to the file path to indicate which artifact or source to find it in. For more information, see Referencing source repository files and Referencing files in an artifact.
-
-
(Optional) Choose Validate to validate the workflow's YAML code before committing.
-
Choose Commit, enter a commit message, and choose Commit again.
- YAML
-
To define an output artifact using the YAML editor
Open the CodeCatalyst console at https://codecatalyst.aws/
. -
Choose your project.
-
In the navigation pane, choose CI/CD, and then choose Workflows.
-
Choose the name of your workflow. You can filter by the source repository or branch name where the workflow is defined, or filter by workflow name or status.
-
Choose Edit.
-
Choose YAML.
-
In a workflow action, add code similar to the following:
action-name
: Outputs: Artifacts: - Name:artifact-name
Files: -file-path-1
-file-path-2
For more examples, see Examples of artifacts. For more information, see the Workflow YAML definition for your action.
-
(Optional) Choose Validate to validate the workflow's YAML code before committing.
-
Choose Commit, enter a commit message, and choose Commit again.