Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Энвер Шукуров
DevOps2022
Commits
053d9f99
Commit
053d9f99
authored
2 years ago
by
Энвер Шукуров
Browse files
Options
Download
Patches
Plain Diff
Update .gitlab-ci.yml file
parent
54d1accb
develop
feature
master
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+42
-25
.gitlab-ci.yml
with
42 additions
and
25 deletions
+42
-25
.gitlab-ci.yml
+
42
−
25
View file @
053d9f99
...
...
@@ -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
:
test
ing
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
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets