Referencing files in an artifact - Amazon CodeCatalyst

Referencing files in an artifact

If you have a file that resides within an artifact, and you need to refer to this file in one of your Amazon CodeCatalyst workflow actions, complete the following procedure.

Visual

Not available. Choose YAML to view the YAML instructions.

YAML
To reference files in an artifact (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 the action where you want to reference a file, add code similar to the following:

    Actions: My-action: Inputs: Sources: - WorkflowSource Artifacts: - artifact-name Configuration: template: artifact-path/path/to/file.yml

    In the previous code, replace:

    • artifact-name with the name of the artifact.

    • artifact-path with a value from the following table.

    If you're adding the reference to... Replace artifact-path with...

    A build action or test action

    $CATALYST_SOURCE_DIR_artifact-name/

    All other actions

    $CATALYST_SOURCE_DIR_artifact-name/

    or

    /artifacts/current-action-name/artifact-name/

    or

    If the current action is within an action group:

    /artifacts/current-action-group@current-action-name/artifact-name/

    For examples, see Examples of artifacts.

    Note

    You can omit the artifact-path and just specify the file path relative to the artifact root directory if:

    • The action where you're including the reference only includes one item under Inputs (for example, it includes one input artifact and no source).

    • The file that you want to reference resides in the primary input. The primary input is either the WorkflowSource, or the first input artifact listed, if there is no WorkflowSource.

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

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