I have three stages in my yml file and i want them to execute in sequence and if any one fails then just don’t want to execute next job. but behaviour is not as expected
stages:
- build
- sonar
- wsdev
- wsprod
build:
stage: build
script:
- /mvn-bd.sh {SKIP_TESTS} {CI_COMMIT_REF_NAME}
tags:
- medium-runner
sonar:
stage: sonar
script:
- echo "sonar Build started for for ${COMPONENT_NAME} "
- /mvn-bd.sh {SKIP_TESTS} {CI_COMMIT_REF_NAME} ${SKIP_DEPLOY}
- mvn -s /settings.xml sonar:sonar -Dsonar.host.url=$SONAR_HOST -Dsonar.projectKey=evb-$COMPONENT_NAME -Dsonar.login=$SONAR_TOKEN
rules:
- if: $CI_MERGE_REQUEST_ID
when: never
- if: CI_COMMIT_REF_NAME=~/dev/ || $CI_COMMIT_REF_NAME == “master” && $CI_MERGE_REQUEST_ID == null
when: always
tags: - medium-runner
wsdev:
stage: wsdev
script:
- echo “Whitesource Build started for for ws dev ${COMPONENT_NAME}”
- /mvn-bd.sh {SKIP_TESTS} {CI_COMMIT_REF_NAME} ${SKIP_DEPLOY}
- sh /wss_agent.sh -c /wss-unified-agent.config -userKey $WS_USER_KEY -apiKey $WS_API_TOKEN -product $WS_P_NAME -project $COMPONENT_NAME
rules:
- if: $CI_MERGE_REQUEST_ID
when: never
- if: CI_COMMIT_REF_NAME=~/dev/ && $CI_MERGE_REQUEST_ID == null
when: always
tags: - medium-runner