Commit 053d9f99 authored by Энвер Шукуров's avatar Энвер Шукуров
Browse files

Update .gitlab-ci.yml file

No related merge requests found
Showing with 42 additions and 25 deletions
+42 -25
......@@ -15,49 +15,66 @@
stages: # List of stages for jobs, and their order of execution
- build
- test
- packing
- deploy
- testing
- packaging
build-job: # This job runs in the build stage, which runs first.
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
workflow:
rules:
- if: $CI_COMMIT_BRANCH_NAME == "master"
variables:
TAG: "lastest"
- if: $CI_COMMIT_BRANCH_NAME == "develop"
variables:
TAG: "dev"
build-application: # This job runs in the build stage, which runs first.
stage: build
tags:
- tekken-tag
- shell
script:
- echo "Compiling the code..."
- echo "Compile complete."
unit-test-job: # This job runs in the test stage.
stage: test
stage: testing
tags:
- tekken-tag # It only starts when the job in the build stage completes successfully.
- shell # It only starts when the job in the build stage completes successfully.
script:
- echo "Running unit tests... This will take about 60 seconds."
- pwd
- echo "Code coverage is 90%"
lint-test-job: # This job also runs in the test stage.
stage: test # It can run at the same time as unit-test-job (in parallel).
stage: testing # It can run at the same time as unit-test-job (in parallel).
only:
- master
- develop
tags:
- tekken-tag
- shell
script:
- echo "Linting code... This will take about 10 seconds."
- ls
- echo "No lint issues found."
packing-test-job:
stage: packing
packaging:
stage: packaging
only:
- master
- develop
- merge_requests
tags:
- tekken-tag
script:
- echo "Packing code... Take approx. 5 seconds."
- sleep 5
- echo "Packing done."
- shell
script:
- echo "Packaging ms-cat... Take approx. 5 seconds."
- docker build --tag $TAG ms-cat/
- docker push pieland/ms-child:$TAG
- echo "Packing ms-cat done."
deploy-job: # This job runs in the deploy stage.
stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
tags:
- tekken-tag
script:
- echo "Deploying application..."
- echo "Application successfully deployed."
# deploy-job: # This job runs in the deploy stage.
# stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
# tags:
# - tekken-tag
# script:
# - echo "Deploying application..."
# - echo "Application successfully deployed."
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment