Skip to content

screwdriver-cd-test/chain-pr-example

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time

Chain PR Example

To use chain PR feature in Screwdriver.cd, set true in pipeline-level annotation screwdriver.cd/chainPR.
Then, subsequent jobs in PR event will be chained according to the workflow in PR.

Example

Firstly, set true in the screwdriver.cd/chainPR annotaion.
This annotation must be configured in main branch.

# screwdriver.yaml in main branch

shared:
    image: node:8

annotations:
    screwdriver.cd/chainPR: true

jobs:
    first-job:
        requires: [ ~pr, ~commit ]
        steps:
            - echo: echo "this is first job."
    second-job:
        requires: [ first-job ]
        steps:
            - echo: echo "this is second job."

Then, if you make a PR, subsequent jobs in PR branch will be chained according to workflow in PR event.
In this example, second-job will be executed after the first-job, and third-job will be executed after the second-job.

# screwdriver.yaml in PR branch

shared:
    image: node:8

annotations:
    screwdriver.cd/chainPR: true

jobs:
    first-job:
        requires: [ ~pr, ~commit ]
        steps:
            - echo: echo "this is first job."
    second-job:
        requires: [ first-job ]
        steps:
            - echo: echo "this is second job."
    third-job:
        requires: [ second-job ]
        steps:
            - echo: echo "this is third job."

Releases

No releases published

Packages

No packages published