Update the deploy arm to work...better

Signed-off-by: Adam Hill <adam@diginc.us>
This commit is contained in:
Adam Hill 2018-07-12 11:34:47 -05:00
parent c17cd37eca
commit ec8f441df3
No known key found for this signature in database
GPG Key ID: 2193804FCA429855
1 changed files with 31 additions and 11 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -e
# Script for manually pushing the docker arm images for diginc only
# (no one else has docker repo permissions)
if [ ! -f ~/.docker/config.json ] ; then
@ -6,20 +6,40 @@ if [ ! -f ~/.docker/config.json ] ; then
exit 1
fi
if [[ "$1" == 'prod' ]] ; then
export version='3.3'
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
branch="$(parse_git_branch)"
version="${version:-unset}"
dry="${dry}"
if [[ -n "$dry" ]] ; then dry='echo ' ; fi
if [[ "$version" == 'unset' && "$branch" == 'master' ]]; then
echo "Version is unset and master/prod branch wants a version...pass in \$version!"
exit 1
fi
echo "# DEPLOYING:\n"
echo "version: $version"
echo "branch: $branch"
[[ -n "$dry" ]] && echo "DRY RUN: $dry"
$dry ./Dockerfile.py
if [[ "$branch" == 'master' ]] ; then
for tag in debian_armhf debian_aarch64; do
# Verison specific tags for ongoing history
docker tag pi-hole-multiarch:$tag diginc/pi-hole-multiarch:v${version}_${tag}
docker push diginc/pi-hole-multiarch:v${version}_${tag}
$dry docker tag pi-hole-multiarch:$tag diginc/pi-hole-multiarch:v${version}_${tag}
$dry docker push diginc/pi-hole-multiarch:v${version}_${tag}
# Floating latest tags
docker tag pi-hole-multiarch:$tag diginc/pi-hole-multiarch:${tag}
docker push diginc/pi-hole-multiarch:${tag}
$dry docker tag pi-hole-multiarch:$tag diginc/pi-hole-multiarch:${tag}
$dry docker push diginc/pi-hole-multiarch:${tag}
done
elif [[ "$1" == 'dev' ]] ; then
else
for tag in debian_armhf debian_aarch64; do
# Floating dev tag
docker tag pi-hole-multiarch:$tag diginc/pi-hole-multiarch:${tag}_dev
docker push diginc/pi-hole-multiarch:${tag}_dev
$dry docker tag pi-hole-multiarch:$tag diginc/pi-hole-multiarch:${tag}_${branch}
$dry docker push diginc/pi-hole-multiarch:${tag}_${branch}
done
fi