Commit a17b4a84 authored by Arie Peterson's avatar Arie Peterson 🐚
Browse files

Add scripts for building docker images

parent 63e408ff
#!/bin/bash
set -o errexit
set -o nounset
image="docker.greenhost.net/open/kubernetes-ghost/driver"
usage() {
echo 'Usage:'
echo ' ./build.sh dev # For building and pushing a development version.'
echo ' ./build.sh release $VERSION # For building and pushing a release version.'
}
if [[ $# -eq 0 ]]
then
echo "No build type given."
usage
exit 1
fi
declare -a tags
buildType=$1
case "$buildType" in
dev)
tags=("dev")
;;
release)
version=$2
tags=("$version" "latest")
;;
*)
echo "Unknown build type: $buildType"
usage
exit 1
;;
esac
for tag in "${tags[@]}"
do
url="$image:$tag"
if [[ -z "${firstImage-}" ]]
then
docker build -t "$url" .
docker push "$url"
firstImage="$url"
else
docker tag "$firstImage" "$url"
docker push "$url"
fi
done
#!/bin/bash
set -o errexit
set -o nounset
image="docker.greenhost.net/open/kubernetes-ghost/provisioner"
usage() {
echo 'Usage:'
echo ' ./build.sh dev # For building and pushing a development version.'
echo ' ./build.sh release $VERSION # For building and pushing a release version.'
}
if [[ $# -eq 0 ]]
then
echo "No build type given."
usage
exit 1
fi
declare -a tags
buildType=$1
case "$buildType" in
dev)
tags=("dev")
;;
release)
version=$2
tags=("$version" "latest")
;;
*)
echo "Unknown build type: $buildType"
usage
exit 1
;;
esac
for tag in "${tags[@]}"
do
url="$image:$tag"
if [[ -z "${firstImage-}" ]]
then
docker build -t "$url" .
docker push "$url"
firstImage="$url"
else
docker tag "$firstImage" "$url"
docker push "$url"
fi
done
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment