Fixed wrinkles in build script
This commit is contained in:
parent
cedcc3fc9f
commit
ab94583e62
3 changed files with 19 additions and 16 deletions
9
build
9
build
|
|
@ -15,7 +15,7 @@ minor_version="$(echo "$patch_version" |
|
|||
branch="$(git branch --show-current)"
|
||||
|
||||
if [[ "$branch" = "master" ]]; then
|
||||
tags=("$patch_version" "$minor_version" "$major_version" )
|
||||
tags=("$patch_version" "$minor_version" "$major_version" "latest" )
|
||||
|
||||
elif [[ "$branch" = "develop" ]]; then
|
||||
tags=("$patch_version-dev" "$minor_version-dev" "$major_version-dev" )
|
||||
|
|
@ -28,7 +28,7 @@ fi
|
|||
tag_flags=()
|
||||
|
||||
for tag in "${tags[@]}"; do
|
||||
tag_flags+=("-t '$1:$tag'")
|
||||
tag_flags+=("-t $1:$tag")
|
||||
|
||||
done
|
||||
|
||||
|
|
@ -36,6 +36,11 @@ done
|
|||
docker build $tag_flags .
|
||||
|
||||
if [[ "$2" = push ]]; then
|
||||
[[ "$branch" =~ ^develop|master$ ]] || {
|
||||
>&2 echo "You can only push from develop or master."
|
||||
exit 2
|
||||
}
|
||||
|
||||
for tag in "${tags[@]}"; do
|
||||
docker push "$1:$tag"
|
||||
done
|
||||
|
|
|
|||
Reference in a new issue