Skip to content
Snippets Groups Projects
Commit 6f51f033 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Adding gitlab-ci yaml file for automatic deployment

parent 2bb5c756
No related branches found
No related tags found
No related merge requests found
Pipeline #3174 passed
# CI/CD:
#
# BUILD triggered by:
# - branches
#
#
Build tosca-ie docker image:
stage: build
before_script:
- cp ./env_example env
script:
- ./relaunch.sh $CI_COMMIT_BRANCH
rules:
- if: $CI_COMMIT_BRANCH
changes:
- Dockerfile
- src/*
- requirements.txt
\ No newline at end of file
...@@ -11,13 +11,13 @@ if [ "$CNT" != "" ] ; then ...@@ -11,13 +11,13 @@ if [ "$CNT" != "" ] ; then
docker stop "$CNT" docker stop "$CNT"
fi fi
if [ "$1" == "stop" ] ; then if [ "$2" == "stop" ] ; then
exit 0 exit 0
fi fi
sed -i -E "s/(LAST_COMMIT=).+/\1$(git log -n 1 --oneline)/" env sed -i -E "s/(LAST_COMMIT=).+/\1$(git rev-parse HEAD)/" env
docker build -t tosca-ie-sample:latest . docker build -t tosca-ie-sample:$1 .
docker run -d --restart unless-stopped -t -p 5000:5000 --env-file ./env tosca-ie-sample docker run -d --restart unless-stopped -t -p 5000:5000 --env-file ./env tosca-ie-sample:$1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment