Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Test-CICD-Project-NgVu
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nguyenvu
Test-CICD-Project-NgVu
Commits
6df6ac9f
Commit
6df6ac9f
authored
May 11, 2021
by
nguyenvu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update project
parent
5f900c13
Pipeline
#6754
canceled with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
17 deletions
+26
-17
.gitlab-ci.yml
.gitlab-ci.yml
+21
-17
.gitmodules
.gitmodules
+4
-0
cicd
cicd
+1
-0
No files found.
.gitlab-ci.yml
View file @
6df6ac9f
...
...
@@ -19,6 +19,7 @@ build:
before_script
:
-
echo "Please remember that for dev environment, we use the tag 'dev' only !!!"
-
tag=dev
-
cicd_path=$(grep "path" .gitmodules | cut -d "=" -f2 | cut -d " " -f2)
-
current_file_path=$(pwd)/MEU.API/Resources/ReleaseNotes/releasenotes.txt
-
release_note_folder=/var/www/release_note
-
|
...
...
@@ -49,11 +50,12 @@ build:
sudo bash -c "echo $value_base64 > $current_file_path"
sudo bash -c "cat $current_file_path > $release_note_folder/$project_name/releasenotes.txt"
-
sudo docker build -t $image_name:$tag -f Dockerfile .
-
sudo docker logout registry.gitlab.com
-
echo "$CI_REGISTRY_PW" | sudo docker login registry.gitlab.com -u "$CI_REGISTRY_USER" --password-stdin
-
sudo docker push $image_name:$tag
-
sudo docker rmi $image_name:$tag
-
sudo bash $cicd_path/build.sh
#- sudo docker build -t $image_name:$tag -f Dockerfile .
#- sudo docker logout registry.gitlab.com
#- echo "$CI_REGISTRY_PW" | sudo docker login registry.gitlab.com -u "$CI_REGISTRY_USER" --password-stdin
#- sudo docker push $image_name:$tag
#- sudo docker rmi $image_name:$tag
only
:
-
develop
tags
:
...
...
@@ -62,6 +64,7 @@ build:
deploy
:
stage
:
deploy
before_script
:
-
cicd_path=$(grep "path" .gitmodules | cut -d "=" -f2 | cut -d " " -f2)
-
whoami
-
ifconfig
-
sudo apt-get install jq -y
...
...
@@ -87,18 +90,19 @@ deploy:
sudo chown -R gitlab-runner.gitlab-runner $mount_data_folder/$project_name
fi
script
:
-
tag=dev
-
jq -r 'keys[] as $k | "\($k)=\(.[$k])"' $environment_json_path > .env
-
sed -i 's|PROJECT-NAME|'$project_name'|' docker-compose.yaml
-
sed -i 's|ENVIRONMENT-NAME|'$environment_name'|' docker-compose.yaml
-
sed -i 's|IMAGE-NAME|'$image_name'|' docker-compose.yaml
-
sed -i 's|IMAGE-TAG|'$tag'|' docker-compose.yaml
-
sed -i 's|P-MAPPING|'$port_mapping'|' docker-compose.yaml
-
sed -i 's|MOUNT-DATA-FOLDER|'$mount_data_folder'|' docker-compose.yaml
-
echo "$CI_REGISTRY_PW" | sudo docker login registry.gitlab.com -u "$CI_REGISTRY_USER" --password-stdin
-
sudo docker-compose down
-
sudo docker-compose pull
-
sudo docker-compose --env-file .env up -d
-
sudo bash deploy.sh
#- tag=dev
#- jq -r 'keys[] as $k | "\($k)=\(.[$k])"' $environment_json_path > .env
#- sed -i 's|PROJECT-NAME|'$project_name'|' docker-compose.yaml
#- sed -i 's|ENVIRONMENT-NAME|'$environment_name'|' docker-compose.yaml
#- sed -i 's|IMAGE-NAME|'$image_name'|' docker-compose.yaml
#- sed -i 's|IMAGE-TAG|'$tag'|' docker-compose.yaml
#- sed -i 's|P-MAPPING|'$port_mapping'|' docker-compose.yaml
#- sed -i 's|MOUNT-DATA-FOLDER|'$mount_data_folder'|' docker-compose.yaml
#- echo "$CI_REGISTRY_PW" | sudo docker login registry.gitlab.com -u "$CI_REGISTRY_USER" --password-stdin
#- sudo docker-compose down
#- sudo docker-compose pull
#- sudo docker-compose --env-file .env up -d
only
:
-
develop
tags
:
...
...
.gitmodules
0 → 100644
View file @
6df6ac9f
[submodule "cicd"]
path = cicd
url = http://27.74.255.96:8088/trainguyen/cicd.git
branch = feature-cicd
cicd
@
926a6d6d
Subproject commit 926a6d6d4e33e266700e8c532fc16f160c8583e2
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment