From 24b6db92bc5cf56a5e2c1da3481ee57bddba7c80 Mon Sep 17 00:00:00 2001 From: Lars Kellogg-Stedman Date: Fri, 3 Oct 2014 16:20:18 -0400 Subject: [PATCH] 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 --- docker/build | 34 ---------- docker/cinder/build | 3 +- docker/cinder/push | 2 - docker/fedora-rdo-base/build | 3 +- docker/fedora-rdo-base/push | 2 - docker/glance/build | 10 --- docker/glance/glance-api/build | 3 +- docker/glance/glance-api/push | 2 - docker/glance/glance-base/build | 3 +- docker/glance/glance-base/push | 2 - docker/glance/glance-registry/build | 3 +- docker/glance/glance-registry/push | 2 - docker/glance/push | 10 --- docker/heat/heat-api/build | 3 +- docker/heat/heat-api/push | 2 - docker/heat/heat-base/build | 3 +- docker/heat/heat-base/push | 2 - docker/heat/heat-engine/build | 3 +- docker/heat/heat-engine/push | 2 - docker/keystone/build | 3 +- docker/keystone/push | 2 - docker/mariadb/build | 3 +- docker/mariadb/push | 2 - docker/nova-compute/build | 2 - docker/nova-compute/nova-base/build | 3 +- docker/nova-compute/nova-base/push | 2 - docker/nova-compute/nova-compute/build | 3 +- docker/nova-compute/nova-compute/push | 2 - docker/nova-compute/nova-libvirt/build | 3 +- docker/nova-compute/nova-libvirt/push | 2 - docker/nova-compute/push | 2 - docker/rabbitmq/build | 3 +- docker/rabbitmq/push | 2 - docker/rhel-osp-base/build | 3 +- docker/swift/swift-account/build | 3 +- docker/swift/swift-account/push | 2 - docker/swift/swift-base/build | 3 +- docker/swift/swift-base/push | 2 - docker/swift/swift-container/build | 3 +- docker/swift/swift-container/push | 2 - docker/swift/swift-object/build | 3 +- docker/swift/swift-object/push | 2 - docker/swift/swift-proxy-server/build | 3 +- docker/swift/swift-proxy-server/push | 2 - docs/image-building.md | 75 ++++++++++++++++++++ tools/build-docker-image | 94 ++++++++++++++++++++++++++ tools/update-build-links | 10 +++ 47 files changed, 199 insertions(+), 136 deletions(-) delete mode 100755 docker/build mode change 100755 => 120000 docker/cinder/build delete mode 100755 docker/cinder/push mode change 100755 => 120000 docker/fedora-rdo-base/build delete mode 100755 docker/fedora-rdo-base/push delete mode 100755 docker/glance/build mode change 100755 => 120000 docker/glance/glance-api/build delete mode 100755 docker/glance/glance-api/push mode change 100755 => 120000 docker/glance/glance-base/build delete mode 100755 docker/glance/glance-base/push mode change 100755 => 120000 docker/glance/glance-registry/build delete mode 100755 docker/glance/glance-registry/push delete mode 100755 docker/glance/push mode change 100755 => 120000 docker/heat/heat-api/build delete mode 100755 docker/heat/heat-api/push mode change 100755 => 120000 docker/heat/heat-base/build delete mode 100755 docker/heat/heat-base/push mode change 100755 => 120000 docker/heat/heat-engine/build delete mode 100755 docker/heat/heat-engine/push mode change 100755 => 120000 docker/keystone/build delete mode 100755 docker/keystone/push mode change 100755 => 120000 docker/mariadb/build delete mode 100755 docker/mariadb/push delete mode 100755 docker/nova-compute/build mode change 100755 => 120000 docker/nova-compute/nova-base/build delete mode 100755 docker/nova-compute/nova-base/push mode change 100755 => 120000 docker/nova-compute/nova-compute/build delete mode 100755 docker/nova-compute/nova-compute/push mode change 100755 => 120000 docker/nova-compute/nova-libvirt/build delete mode 100755 docker/nova-compute/nova-libvirt/push delete mode 100755 docker/nova-compute/push mode change 100755 => 120000 docker/rabbitmq/build delete mode 100755 docker/rabbitmq/push mode change 100755 => 120000 docker/rhel-osp-base/build mode change 100755 => 120000 docker/swift/swift-account/build delete mode 100755 docker/swift/swift-account/push mode change 100755 => 120000 docker/swift/swift-base/build delete mode 100755 docker/swift/swift-base/push mode change 100755 => 120000 docker/swift/swift-container/build delete mode 100755 docker/swift/swift-container/push mode change 100755 => 120000 docker/swift/swift-object/build delete mode 100755 docker/swift/swift-object/push mode change 100755 => 120000 docker/swift/swift-proxy-server/build delete mode 100755 docker/swift/swift-proxy-server/push create mode 100644 docs/image-building.md create mode 100755 tools/build-docker-image create mode 100755 tools/update-build-links diff --git a/docker/build b/docker/build deleted file mode 100755 index 7c92688705..0000000000 --- a/docker/build +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# If the directories were numbered, a simple find could be used to build ;-) -push= - -CONTAINERS=(fedora-rdo-base cinder glance/glance-base glance/glance-api glance/glance-registry heat/heat-base heat/heat-api heat/heat-engine keystone mariadb rabbitmq swift/swift-base swift/swift-account swift/swift-container swift/swift-object swift/swift-proxy-server nova-compute/nova-base nova-compute/nova-compute nova-compute/nova-libvirt) - - -while getopts "hp" opt > /dev/null 2>&1; do - case $opt in - p) - push=yes - ;; - h) - 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 <