-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update GitLab CI/CD script #11
Conversation
cc @paulRbr , I've open this PR following yesterday discussions. WDYT of these suggestions? May I ask your help about why circleCI failed (no change in this PR at first sight) 🙏 |
.gitlab-ci.yml
Outdated
|
||
diff_doc: | ||
stage: test | ||
script: | ||
- ./.gitlab/diff-comment-mr.sh bump.openapi.v3.yml | ||
- ./.gitlab/diff-comment-mr.sh 'bump.openapi.v3.yml' bump_token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of adding a comment in the sh script, you can call sh here directly which removes the necessity for the execution flag on the script file:
- ./.gitlab/diff-comment-mr.sh 'bump.openapi.v3.yml' bump_token | |
- sh ./.gitlab/diff-comment-mr.sh "bump.openapi.v3.yml" "bump_documentation_slug" "bump_token" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for suggestion and comment, I've adapted script consequently.
- run script with
sh
and remove comment aboutchmode
- adapt call to this script, with 3 parameters
"bump.openapi.v3.yml" "bump_documentation_slug" "bump_token"
f563981
to
5dc617f
Compare
Current script assumes that node package bump-cli is installed in the application where this GitLab CI/CD script is used, hence the presence of a 'package.json' configuration file. But this script can also be run with more simplicity: package 'bump-cli' is found and installed by npm during CI/CD process.
Add parameters documentation_slug and bump_token. These can be defined with GitLab CI/CD variables: https://docs.gitlab.com/ee/ci/variables/index.html#protect-a-cicd-variable And add double quotes around 'path/to/specification', required to run script on GitLab. Call 'diff-comment-mr' file script with `sh`, no need to update rights to be executable.
5dc617f
to
c66af19
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything seems to be fine on https://gitlab.com/bump-sh/bump-ci-example/-/merge_requests/3
let's merge this!
Some suggestions noticed by testing the script on a test repository on GitLab:
bump-cli
package in 'package.json'sh
to call 'diff-comment-mr.sh' and thus override execution rights missing (or it crashes, cf this job )