|
1 | 1 | version: 2.1
|
2 |
| - |
3 |
| -# add your orb below, to be used in integration tests (note: a @dev:alpha |
4 |
| -# release must exist.); |
| 2 | +setup: true |
5 | 3 | orbs:
|
6 |
| - heroku: circleci/heroku@<<pipeline.parameters.dev-orb-version>> |
7 |
| - orb-tools: circleci/orb-tools@10 |
8 |
| - |
9 |
| -# Pipeline parameters |
10 |
| -parameters: |
11 |
| - run-integration-tests: |
12 |
| - description: An internal flag to prevent integration test from running before a development version has been created. |
13 |
| - type: boolean |
14 |
| - default: false |
15 |
| - dev-orb-version: |
16 |
| - description: > |
17 |
| - The development version of the orb to test. |
18 |
| - This value is automatically adjusted by the "trigger-integration-tests-workflow" job to correspond with the specific version created by the commit and should not be edited. |
19 |
| - A "dev:alpha" version must exist for the initial pipeline run. |
20 |
| - type: string |
21 |
| - default: "dev:alpha" |
| 4 | + orb-tools: circleci/[email protected] |
| 5 | + shellcheck: circleci/[email protected] |
22 | 6 |
|
23 |
| -jobs: |
24 |
| - # This job is an example of an integration testing job. |
25 |
| - # This job should execute a command from your orb and verify |
26 |
| - # the output is as expected, otherwise the job should fail. |
27 |
| - # |
28 |
| - # Rename this job and add more as needed. |
29 |
| - # |
30 |
| - integration-test-1: |
31 |
| - executor: heroku/default |
32 |
| - steps: |
33 |
| - - checkout |
34 |
| - - heroku/install |
35 |
| - - run: |
36 |
| - name: Check if Heroku is installed |
37 |
| - command: | |
38 |
| - if [[ $(command -v heroku) == "" ]]; then |
39 |
| - echo " Heroku is not installed! "; exit 1; |
40 |
| - else |
41 |
| - echo Heroku successfully installed. |
42 |
| - fi |
43 |
| - integration-test-review: |
44 |
| - executor: heroku/default |
45 |
| - steps: |
46 |
| - - run: |
47 |
| - name: Setup sample project |
48 |
| - command: | |
49 |
| - git clone --depth 1 https://github.com/CircleCI-Public/sample-python-cfd.git --branch main ~/project |
50 |
| - git branch $CIRCLE_BRANCH |
51 |
| - - run: |
52 |
| - name: Bundle sample project |
53 |
| - working_directory: ~/ |
54 |
| - command: tar -czvf sample-python-cfd.tar.gz ~/project |
55 |
| - - store_artifacts: |
56 |
| - path: ~/sample-python-cfd.tar.gz |
57 |
| - - heroku/create-review: |
58 |
| - artifact-pattern: "*.tar.gz" |
59 |
| - pipeline: 389303dc-8a12-4f25-b943-8f7c6dbbdcaa |
60 |
| - circleci-api-key: CIRCLE_TOKEN |
61 |
| - integration-test-deploy: |
62 |
| - executor: heroku/default |
63 |
| - steps: |
64 |
| - - run: |
65 |
| - name: Setup sample project |
66 |
| - command: | |
67 |
| - git clone --depth 1 https://github.com/CircleCI-Public/sample-python-cfd.git --branch main ~/project |
68 |
| - git branch $CIRCLE_BRANCH |
69 |
| - - heroku/install |
70 |
| - - heroku/check-authentication |
71 |
| - - heroku/deploy-via-git: |
72 |
| - force: true |
73 |
| - app-name: sample-python-cfd |
| 7 | +filters: &filters |
| 8 | + tags: |
| 9 | + only: /.*/ |
74 | 10 |
|
75 | 11 | workflows:
|
76 |
| - # This `lint-pack_validate_publish-dev` workflow will run on any commit. |
77 |
| - lint_pack-validate_publish-dev: |
78 |
| - unless: << pipeline.parameters.run-integration-tests >> |
| 12 | + lint-pack: |
79 | 13 | jobs:
|
80 |
| - - orb-tools/lint |
81 |
| - # pack your orb YAML files to a single orb.yml |
82 |
| - # validate the orb.yml file to ensure it is well-formed |
| 14 | + - orb-tools/lint: |
| 15 | + filters: *filters |
83 | 16 | - orb-tools/pack:
|
84 |
| - requires: |
85 |
| - - orb-tools/lint |
86 |
| - |
87 |
| - # release dev version of orb, for testing & possible publishing. |
88 |
| - # orb will be published as dev:alpha and dev:${CIRCLE_SHA1:0:7}. |
89 |
| - # requires a CircleCI API token to be stored as CIRCLE_TOKEN (default) |
90 |
| - # https://circleci.com/docs/2.0/managing-api-tokens |
91 |
| - # store CIRCLE_TOKEN as a project env var or Contexts resource |
92 |
| - # if using Contexts, add your context below |
93 |
| - - orb-tools/publish-dev: |
| 17 | + filters: *filters |
| 18 | + - orb-tools/review: |
| 19 | + filters: *filters |
| 20 | + - shellcheck/check: |
| 21 | + filters: *filters |
| 22 | + - orb-tools/publish: |
94 | 23 | orb-name: circleci/heroku
|
95 |
| - context: orb-publisher |
| 24 | + vcs-type: << pipeline.project.type >> |
96 | 25 | requires:
|
97 |
| - - orb-tools/pack |
98 |
| - |
99 |
| - # trigger an integration workflow to test the |
100 |
| - # dev:${CIRCLE_SHA1:0:7} version of your orb |
101 |
| - - orb-tools/trigger-integration-tests-workflow: |
102 |
| - name: trigger-integration-dev |
| 26 | + [orb-tools/lint, orb-tools/review, orb-tools/pack, shellcheck/check] |
| 27 | + # Use a context to hold your publishing token. |
103 | 28 | context: orb-publisher
|
104 |
| - requires: |
105 |
| - - orb-tools/publish-dev |
106 |
| - |
107 |
| - # This `integration-tests_prod-release` workflow will only run |
108 |
| - # when the run-integration-tests pipeline parameter is set to true. |
109 |
| - # It is meant to be triggered by the "trigger-integration-tests-workflow" |
110 |
| - # job, and run tests on <your orb>@dev:${CIRCLE_SHA1:0:7}. |
111 |
| - integration-tests_prod-release: |
112 |
| - when: << pipeline.parameters.run-integration-tests >> |
113 |
| - jobs: |
114 |
| - # your integration test jobs go here: essentially, run all your orb's |
115 |
| - # jobs and commands to ensure they behave as expected. or, run other |
116 |
| - # integration tests of your choosing |
117 |
| - |
118 |
| - # an example job |
119 |
| - - integration-test-1 |
120 |
| - - integration-test-deploy: |
121 |
| - context: heroku-orb |
122 |
| - - integration-test-review: |
123 |
| - context: |
124 |
| - - heroku-orb |
125 |
| - - orb-publisher |
126 |
| - # publish a semver version of the orb. relies on |
127 |
| - # the commit subject containing the text "[semver:patch|minor|major|skip]" |
128 |
| - # as that will determine whether a patch, minor or major |
129 |
| - # version will be published or if publishing should |
130 |
| - # be skipped. |
131 |
| - # e.g. [semver:patch] will cause a patch version to be published. |
132 |
| - - orb-tools/dev-promote-prod-from-commit-subject: |
133 |
| - orb-name: circleci/heroku |
134 |
| - context: orb-publisher |
135 |
| - add-pr-comment: true |
136 |
| - bot-token-variable: GHI_TOKEN |
137 |
| - bot-user: orb-publisher |
138 |
| - fail-if-semver-not-indicated: true |
139 |
| - publish-version-tag: false |
140 |
| - requires: |
141 |
| - - integration-test-1 |
142 |
| - - integration-test-deploy |
143 |
| - filters: |
144 |
| - branches: |
145 |
| - only: master |
| 29 | + filters: *filters |
| 30 | + # Triggers the next workflow in the Orb Development Kit. |
| 31 | + - orb-tools/continue: |
| 32 | + pipeline-number: << pipeline.number >> |
| 33 | + vcs-type: << pipeline.project.type >> |
| 34 | + requires: [orb-tools/publish] |
| 35 | + filters: *filters |
0 commit comments