53 lines
1.1 KiB
Bash
Executable File
53 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
######
|
|
# This script is used to publish images to ECR.
|
|
# It exepcts images to be already built on the local docker
|
|
# It expects docker to be logged in to ECR (see aws-login)
|
|
|
|
set -e
|
|
|
|
VERBOSE=0
|
|
|
|
DIR=`dirname $(realpath "${BASH_SOURCE[0]}")`
|
|
OLDDIR=`pwd`
|
|
cd "$DIR"
|
|
|
|
source "$DIR/../config"
|
|
source "$DIR/libs.sh"
|
|
|
|
usage() {
|
|
echo "Usage: $0 [-h] [-v] [-t: version]" 1>&2;
|
|
echo "This script pushes framework docker images, the following options are available:" 1>&2;
|
|
echo " -h: This message" 1>&2;
|
|
echo " -t: Framework version, this will be used as base for the docker image tag (default: local)" 1>&2;
|
|
echo " -v: Verbose" 1>&2;
|
|
exit 1;
|
|
}
|
|
|
|
TAG=""
|
|
|
|
while getopts "t:hv" o; do
|
|
case "${o}" in
|
|
t)
|
|
TAG=${OPTARG}
|
|
;;
|
|
v)
|
|
VERBOSE=1
|
|
;;
|
|
h)
|
|
usage
|
|
;;
|
|
*)
|
|
printerr "Unsupported option ${o}"
|
|
usage
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [[ $TAG == "" ]]; then
|
|
printerr "Tag (-t) is required"
|
|
fi
|
|
|
|
msg "Pushing project version $TAG"
|
|
docker push $PROJECT_REPOSITORY/$PROJECT_GROUP/$PROJECT_BUILDNAME:$TAG
|