Commit 6df6ac9f authored by nguyenvu's avatar nguyenvu

Update project

parent 5f900c13
Pipeline #6754 canceled with stages
......@@ -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:
......
[submodule "cicd"]
path = cicd
url = http://27.74.255.96:8088/trainguyen/cicd.git
branch = feature-cicd
cicd @ 926a6d6d
Subproject commit 926a6d6d4e33e266700e8c532fc16f160c8583e2
Markdown is supported
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