Created
July 18, 2022 07:18
-
-
Save troke12/148383c2521ddeba09069449b502f669 to your computer and use it in GitHub Desktop.
Building docker with current branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
branch=$(git symbolic-ref --short HEAD) | |
case $branch in | |
"development") | |
prefix="dev" | |
cp .env.development .env | |
;; | |
"staging") | |
prefix="stag" | |
cp .env.staging .env | |
;; | |
"master" | *) | |
prefix="master" | |
echo "done master" | |
;; | |
esac | |
echo "\nStarting building docker..." | |
docker build . -t chatnews-$prefix:latest | |
git restore .env | |
echo "\nSuccess restoring .env.." | |
echo "\nDone Building Docker in branch $branch" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment