Defining an output artifact - Amazon CodeCatalyst

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
  1. Open the CodeCatalyst console at https://codecatalyst.aws/.

  2. Choose your project.

  3. In the navigation pane, choose CI/CD, and then choose Workflows.

  4. 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.

  5. Choose Edit.

  6. Choose Visual.

  7. In the workflow diagram, choose the action that will produce the artifact.

  8. Choose the Outputs tab.

  9. Under Artifacts, choose Add artifact.

  10. 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 or directory/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.

  11. (Optional) Choose Validate to validate the workflow's YAML code before committing.

  12. Choose Commit, enter a commit message, and choose Commit again.

YAML
To define an output artifact using the YAML editor
  1. Open the CodeCatalyst console at https://codecatalyst.aws/.

  2. Choose your project.

  3. In the navigation pane, choose CI/CD, and then choose Workflows.

  4. 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.

  5. Choose Edit.

  6. Choose YAML.

  7. 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.

  8. (Optional) Choose Validate to validate the workflow's YAML code before committing.

  9. Choose Commit, enter a commit message, and choose Commit again.