|
| 1 | +version: 2.1 |
| 2 | + |
| 3 | +orbs: |
| 4 | + ztraining2strigo: zenika-training/ztraining2strigo@<<pipeline.parameters.dev-orb-version>> |
| 5 | + orb-tools: circleci/orb-tools@10.0 |
| 6 | + |
| 7 | +# Pipeline Parameters |
| 8 | +## These parameters are used internally by orb-tools. Skip to the Jobs section. |
| 9 | +parameters: |
| 10 | + run-integration-tests: |
| 11 | + description: An internal flag to prevent integration test from running before a development version has been created. |
| 12 | + type: boolean |
| 13 | + default: false |
| 14 | + dev-orb-version: |
| 15 | + description: > |
| 16 | + The development version of the orb to test. |
| 17 | + 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. |
| 18 | + A "dev:alpha" version must exist for the initial pipeline run. |
| 19 | + type: string |
| 20 | + default: "dev:alpha" |
| 21 | + |
| 22 | +workflows: |
| 23 | + # Prior to producing a development orb (which requires credentials) basic validation, linting, and even unit testing can be performed. |
| 24 | + # This workflow will run on every commit |
| 25 | + test-pack: |
| 26 | + unless: << pipeline.parameters.run-integration-tests >> |
| 27 | + jobs: |
| 28 | + - orb-tools/lint # Lint Yaml files |
| 29 | + - orb-tools/pack # Pack orb source |
| 30 | + # Publish development version(s) of the orb. |
| 31 | + - orb-tools/publish-dev: |
| 32 | + orb-name: zenika-training/ztraining2strigo |
| 33 | + context: orb-publishing # A restricted context containing your private publishing credentials. Will only execute if approved by an authorized user. |
| 34 | + requires: |
| 35 | + - orb-tools/lint |
| 36 | + - orb-tools/pack |
| 37 | + # Trigger an integration workflow to test the |
| 38 | + # dev:${CIRCLE_SHA1:0:7} version of your orb |
| 39 | + - orb-tools/trigger-integration-tests-workflow: |
| 40 | + name: trigger-integration-dev |
| 41 | + context: orb-publishing |
| 42 | + requires: |
| 43 | + - orb-tools/publish-dev |
| 44 | + filters: |
| 45 | + branches: |
| 46 | + only: |
| 47 | + - main |
| 48 | + |
| 49 | + # This `integration-test_deploy` workflow will only run |
| 50 | + # when the run-integration-tests pipeline parameter is set to true. |
| 51 | + # It is meant to be triggered by the "trigger-integration-tests-workflow" |
| 52 | + # job, and run tests on <your orb>@dev:${CIRCLE_SHA1:0:7}. |
| 53 | + integration-test_deploy: |
| 54 | + when: << pipeline.parameters.run-integration-tests >> |
| 55 | + jobs: |
| 56 | + # Publish a semver version of the orb. relies on |
| 57 | + # the commit subject containing the text "[semver:patch|minor|major|skip]" |
| 58 | + # as that will determine whether a patch, minor or major |
| 59 | + # version will be published or if publishing should |
| 60 | + # be skipped. |
| 61 | + # e.g. [semver:patch] will cause a patch version to be published. |
| 62 | + - orb-tools/dev-promote-prod-from-commit-subject: |
| 63 | + orb-name: zenika-training/ztraining2strigo |
| 64 | + context: orb-publishing |
| 65 | + add-pr-comment: false |
| 66 | + fail-if-semver-not-indicated: true |
| 67 | + publish-version-tag: false |
| 68 | + filters: |
| 69 | + branches: |
| 70 | + only: |
| 71 | + - main |
0 commit comments