From 24b6db92bc5cf56a5e2c1da3481ee57bddba7c80 Mon Sep 17 00:00:00 2001 From: Lars Kellogg-Stedman Date: Fri, 3 Oct 2014 16:20:18 -0400 Subject: introduce a new build mechanism This patch replaces the collection of individual "build" scripts with a single script (tools/build-docker-image), made available as "build" inside each image directory. The build-docker-image script will, by default, build images tagged with the current commit id in order to prevent developers from accidentally stepping on each other or on release images. Documentation in docs/image-building.md describes the script in more detail. Change-Id: I444d5c2256a85223f8750a0904cb4b07f18ab67f --- tools/build-docker-image | 94 ++++++++++++++++++++++++++++++++++++++++++++++++ tools/update-build-links | 10 ++++++ 2 files changed, 104 insertions(+) create mode 100755 tools/build-docker-image create mode 100755 tools/update-build-links (limited to 'tools') diff --git a/tools/build-docker-image b/tools/build-docker-image new file mode 100755 index 000000000..66e534fa4 --- /dev/null +++ b/tools/build-docker-image @@ -0,0 +1,94 @@ +#!/bin/bash + +NAMESPACE=kollaglue +PREFIX=fedora-rdo- +TAG=$(git rev-parse --short HEAD) +IMAGE="${PREFIX}${PWD##*/}" + +TOPDIR=$(git rev-parse --show-toplevel) + +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 + 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 + +FULLIMAGE="${NAMESPACE}/${IMAGE}${TAG:+:${TAG}}" + +cat <