Creating a workflow - Amazon CodeCatalyst

Creating a workflow

A workflow is an automated procedure that describes how to build, test, and deploy your code as part of a continuous integration and continuous delivery (CI/CD) system. A workflow defines a series of steps, or actions, to take during a workflow run. A workflow also defines the events, or triggers, that cause the workflow to start. To set up a workflow, you create a workflow definition file using the CodeCatalyst console's visual or YAML editor.

Tip

For a quick look at how you might use workflows in a project, create a project with a blueprint. Each blueprint deploys a functioning workflow that you can review, run, and experiment with.

Use the following procedure to create a workflow in CodeCatalyst. The workflow will be stored as a YAML file in a ~/.codecatalyst/workflows/ folder in the chosen source repository. Optionally, you can store the workflow in a subfolder of ~/.codecatalyst/workflows/ by prefacing the workflow file name with a folder name when you commit it. For more information, see the following instructions.

For more information about workflows, see Build, test, and deploy with workflows.

Visual
To create a workflow 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 Create workflow.

    The Create workflow dialog box appears.

  5. In the Source repository field, choose a source repository where the workflow definition file will reside. If no source repository exists, create one.

  6. In the Branch field, choose a branch where the workflow definition file will reside.

  7. Choose Create.

    Amazon CodeCatalyst saves the repository and branch information in memory, but the workflow is not yet committed.

  8. Choose Visual.

  9. Build the workflow:

    1. (Optional) In the workflow diagram, choose the Source and Triggers box. A Triggers pane appears. Choose Add trigger to add a trigger. For more information, see Adding triggers to workflows.

    2. Choose + Actions (top-left). The Actions catalog appears.

    3. Choose the plus sign (+) inside an action to add it to the workflow. Use the pane on the right to configure the action. For more information, see Adding an action to a workflow.

    4. (Optional) Choose Workflow properties (top-right). A Workflow properties pane appears. Configure the workflow name run mode, and compute. For more information, see Configuring the queuing behavior of runs and Configuring compute and runtime images.

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

  11. Choose Commit, and on the Commit workflow dialog box, do the following:

    1. For Workflow file name, leave the default name or enter your own. The file will be stored in a ~/.codecatalyst/workflows/ folder in the chosen source repository and branch. You can preface the file name with a folder or subfolder. Examples:

      • Specifying my-workflow (no folder) stores the file as ~/.codecatalyst/workflows/my-workflow.yaml

      • Specifying folder/subfolder/my-workflow stores the file as ~/.codecatalyst/workflows/folder/subfolder/my-workflow.yaml

    2. For Commit message, leave the default message or enter your own.

    3. For Repository and Branch, choose the source repository and branch for the workflow definition file. These fields should be set to the repository and branch that you specified earlier in the Create workflow dialog box. You can change the repository and branch now, if you'd like.

      Note

      After committing your workflow definition file, it cannot be associated with another repository or branch, so make sure to choose them carefully.

    4. Choose Commit to commit the workflow definition file.

YAML
To create a workflow 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 Create workflow.

    The Create workflow dialog box appears.

  5. In the Source repository field, choose a source repository where the workflow definition file will reside. If no source repository exists, create one.

  6. In the Branch field, choose a branch where the workflow definition file will reside.

  7. Choose Create.

    Amazon CodeCatalyst saves the repository and branch information in memory, but the workflow is not yet committed.

  8. Choose YAML.

  9. Build the workflow:

    1. (Optional) Add a trigger to the YAML code. For more information, see Adding triggers to workflows.

    2. Choose + Actions (top-left). The Actions catalog appears.

    3. Choose the plus sign (+) inside an action to add it to the workflow. Use the pane on the right to configure the action. For more information, see Adding an action to a workflow.

    4. (Optional) Choose Workflow properties (top-right). A Workflow properties pane appears. Configure the workflow name, run mode, and compute. For more information, see Configuring the queuing behavior of runs and Configuring compute and runtime images.

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

  11. Choose Commit, and on the Commit workflow dialog box, do the following:

    1. For Workflow file name, leave the default name or enter your own. The file will be stored in a ~/.codecatalyst/workflows/ folder in the chosen source repository and branch. You can preface the file name with a folder or subfolder. Examples:

      • Specifying my-workflow (no folder) stores the file as ~/.codecatalyst/workflows/my-workflow.yaml

      • Specifying folder/subfolder/my-workflow stores the file as ~/.codecatalyst/workflows/folder/subfolder/my-workflow.yaml

    2. For Commit message, leave the default message or enter your own.

    3. For Repository and Branch, choose the source repository and branch for the workflow definition file. These fields should be set to the repository and branch that you specified earlier in the Create workflow dialog box. You can change the repository and branch now, if you'd like.

      Note

      After committing your workflow definition file, it cannot be associated with another repository or branch, so make sure to choose them carefully.

    4. Choose Commit to commit the workflow definition file.