diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 10b888b..b76e235 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,19 @@ -image: node:15 +image: node:18 stages: - test - deploy +# About installation of bump-cli as node package. +# Script here assume that node package 'bump-cli' has previously beeing installed, +# and is available in package.json (More information about our CLI: https://github.com/bump-sh/cli) + +# You can also let npm install the package itself: +# In this case, script here can be adapted: +# - 'cache' and 'before_script' can be removed +# - remplace every call to 'bump' package by 'bump-cli', for example: +# - npm exec -- bump-cli deploy --dry-run 'path/to/your/file' for validation + cache: key: files: @@ -18,24 +28,24 @@ before_script: validate_doc: stage: test script: - - npm exec -- bump deploy --dry-run bump.openapi.v3.yml + - npm exec -- bump deploy --dry-run "bump.openapi.v3.yml" --doc "$BUMP_ID" --token "$BUMP_TOKEN" only: - branches except: - - master + - main deploy_doc: stage: deploy script: - - npm exec -- bump deploy bump.openapi.v3.yml + - npm exec -- bump deploy "bump.openapi.v3.yml" --doc "$BUMP_ID" --token "$BUMP_TOKEN" only: - - master + - main diff_doc: stage: test script: - - ./.gitlab/diff-comment-mr.sh bump.openapi.v3.yml + - sh ./.gitlab/diff-comment-mr.sh "bump.openapi.v3.yml" "$BUMP_ID" "$BUMP_TOKEN" only: - merge_requests except: - - master + - main diff --git a/.gitlab/diff-comment-mr.sh b/.gitlab/diff-comment-mr.sh index 00057c3..a05cb2e 100755 --- a/.gitlab/diff-comment-mr.sh +++ b/.gitlab/diff-comment-mr.sh @@ -5,7 +5,7 @@ # - 2. The bump slug (`BUMP_ID`) # - 3. The Bump token (`BUMP_TOKEN`) # -# Usage: ./diff-comment-mr.sh doc/openapi.yml my-doc my-bump-token-123 +# Usage: ./diff-comment-mr.sh "doc/openapi.yml" "bump_documentation_slug" "bump_token" # bump_preview() {