I have following gitlab-ci conf. file:
before_script:
- echo %CI_BUILD_REF%
- echo %CI_PROJECT_DIR%
stages:
- createPBLs
- build
- package
creat
I recommend to use pattern in varibles-expression using commits
Example
build_api:
stage: build
script:
- docker build --pull -t $CONTAINER_TEST_IMAGE .
- docker push $CONTAINER_TEST_IMAGE
only:
variables:
- $CI_COMMIT_MESSAGE =~ /(\[pipeline\]|(merge))/
Here i am saying that only execute that job when have [pipeline] or merge inside the commit. More info, here in
gitlab