40 lines
804 B
YAML
40 lines
804 B
YAML
workflow:
|
|
rules:
|
|
- if: $CI_PIPELINE_SOURCE == "merge request event"
|
|
- if: $CI_COMMIT_BRANHC && $CI_OPEN_MERGE_REQUESTS
|
|
when: never
|
|
- if: $CI_COMMIT_BRANCH
|
|
- if: $CI_PIPELINE_TAG
|
|
|
|
stages:
|
|
- build
|
|
- test
|
|
- deploy
|
|
|
|
build-job:
|
|
stage: build
|
|
script:
|
|
- echo "Compiling the code..."
|
|
- echo "Compile complete."
|
|
|
|
unit-test-job:
|
|
stage: test
|
|
script:
|
|
- echo "Running unit tests... This will take about 60 seconds."
|
|
- sleep 60
|
|
- echo "Code coverage is 90%"
|
|
|
|
lint-test-job:
|
|
stage: test
|
|
script:
|
|
- echo "Linting code... This will take about 10 seconds."
|
|
- sleep 10
|
|
- echo "No lint issues found."
|
|
|
|
deploy-job:
|
|
stage: deploy
|
|
environment: production
|
|
script:
|
|
- echo "Deploying application..."
|
|
- echo "Application successfully deployed."
|