diff --git a/deploy_prod.sh b/deploy_prod.sh index 45e4fab1c7546f4fee910569eb5e392d76010c58..145fd9f2f00a5aebcc4d42cda275fb26d9d32f49 100755 --- a/deploy_prod.sh +++ b/deploy_prod.sh @@ -1,2 +1,9 @@ -docker build -t gitlab.rrz.uni-hamburg.de:4567/cosy-bio/drugst.one/backend:prod -f ./Dockerfile . -docker push gitlab.rrz.uni-hamburg.de:4567/cosy-bio/drugst.one/backend:prod \ No newline at end of file +#!/bin/bash + +branch=$(git rev-parse --abbrev-ref HEAD) +if [ "$branch" == "production" ]; then + docker build -t gitlab.rrz.uni-hamburg.de:4567/cosy-bio/drugst.one/backend:prod -f ./Dockerfile . + docker push gitlab.rrz.uni-hamburg.de:4567/cosy-bio/drugst.one/backend:prod +else + echo "DENIED: Your are not in the production branch. Do not push to production from the ${branch} branch." +fi