#!/bin/bash TOPDIR=$(git rev-parse --show-toplevel) RELEASE_NAMESPACE=kollaglue NAMESPACE=kollaglue PREFIX=fedora-rdo- TAG=$(git rev-parse --short HEAD) usage () { cat < --tag, -t --push, -p --no-cache, -N --release EOF } [ -f ./.buildconf ] && . ./.buildconf [ -f $TOPDIR/.buildconf ] && . $TOPDIR/.buildconf ARGS=$(getopt -o 'n:t:pN' -l help,namespace:,push,release,tag:,no-cache -- "$@") || { usage >&2; exit 2; } eval set -- "$ARGS" while :; do case "$1" in (--help) usage exit 0 ;; (--release) MODE=release NAMESPACE=$RELEASE_NAMESPACE TAG=latest ;; (--tag|-t) shift TAG="$1" ;; (--push|-p) PUSH=1 ;; (--no-cache|-N) BUILDFLAGS="${BUILDFLAGS} --no-cache" ;; (--namespace|-n) shift NAMESPACE="$1" ;; (--) break ;; esac shift done if [ "$NAMESPACE" = "$RELEASE_NAMESPACE" ] \ && [ "$TAG" = "latest" ] \ && ! [ "$MODE" = "release" ]; then echo "ERROR: use --release to build a release image" >&2 exit 1 fi IMAGE="${PREFIX}${PWD##*/}" FULLIMAGE="${NAMESPACE}/${IMAGE}${TAG:+:${TAG}}" cat <