From fdbd3dc51bea71cf87da4b1760d29003b5c401ac Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Tue, 29 Aug 2017 18:41:22 -0400 Subject: [PATCH] Break release into pieces, build images in parallel --- hack/build-images.sh | 46 ++++++++++++++++++++++++++------------------ hack/release.sh | 16 +++++++++++++-- 2 files changed, 41 insertions(+), 21 deletions(-) diff --git a/hack/build-images.sh b/hack/build-images.sh index 14c850ce3cb7..21c2a3908607 100755 --- a/hack/build-images.sh +++ b/hack/build-images.sh @@ -43,28 +43,36 @@ ln_or_cp "${OS_OUTPUT_BINPATH}/linux/amd64/gitserver" examples/gitserver/b tag_prefix="${OS_IMAGE_PREFIX:-"openshift/origin"}" # images that depend on "${tag_prefix}-source" -os::build::image "${tag_prefix}-pod" images/pod -os::build::image "${tag_prefix}-cluster-capacity" images/cluster-capacity -os::build::image "${tag_prefix}-service-catalog" images/service-catalog +( os::build::image "${tag_prefix}-pod" images/pod ) & +( os::build::image "${tag_prefix}-cluster-capacity" images/cluster-capacity ) & +( os::build::image "${tag_prefix}-service-catalog" images/service-catalog ) & + +for i in `jobs -p`; do wait $i; done # images that depend on "${tag_prefix}-base" -os::build::image "${tag_prefix}" images/origin -os::build::image "${tag_prefix}-haproxy-router" images/router/haproxy -os::build::image "${tag_prefix}-keepalived-ipfailover" images/ipfailover/keepalived -os::build::image "${tag_prefix}-docker-registry" images/dockerregistry -os::build::image "${tag_prefix}-egress-router" images/egress/router -os::build::image "${tag_prefix}-egress-http-proxy" images/egress/http-proxy -os::build::image "${tag_prefix}-federation" images/federation +( os::build::image "${tag_prefix}" images/origin ) & +( os::build::image "${tag_prefix}-haproxy-router" images/router/haproxy ) & +( os::build::image "${tag_prefix}-keepalived-ipfailover" images/ipfailover/keepalived ) & +( os::build::image "${tag_prefix}-docker-registry" images/dockerregistry ) & +( os::build::image "${tag_prefix}-egress-router" images/egress/router ) & +( os::build::image "${tag_prefix}-egress-http-proxy" images/egress/http-proxy ) & +( os::build::image "${tag_prefix}-federation" images/federation ) & + +for i in `jobs -p`; do wait $i; done + # images that depend on "${tag_prefix} -os::build::image "${tag_prefix}-gitserver" examples/gitserver -os::build::image "${tag_prefix}-deployer" images/deployer -os::build::image "${tag_prefix}-recycler" images/recycler -os::build::image "${tag_prefix}-docker-builder" images/builder/docker/docker-builder -os::build::image "${tag_prefix}-sti-builder" images/builder/docker/sti-builder -os::build::image "${tag_prefix}-f5-router" images/router/f5 -os::build::image "openshift/node" images/node +( os::build::image "${tag_prefix}-gitserver" examples/gitserver ) & +( os::build::image "${tag_prefix}-deployer" images/deployer ) & +( os::build::image "${tag_prefix}-recycler" images/recycler ) & +( os::build::image "${tag_prefix}-docker-builder" images/builder/docker/docker-builder ) & +( os::build::image "${tag_prefix}-sti-builder" images/builder/docker/sti-builder ) & +( os::build::image "${tag_prefix}-f5-router" images/router/f5 ) & +( os::build::image "openshift/node" images/node ) & + +for i in `jobs -p`; do wait $i; done + # images that depend on "openshift/node" -os::build::image "openshift/openvswitch" images/openvswitch +( os::build::image "openshift/openvswitch" images/openvswitch ) & # extra images (not part of infrastructure) -os::build::image "openshift/hello-openshift" examples/hello-openshift \ No newline at end of file +( os::build::image "openshift/hello-openshift" examples/hello-openshift ) & \ No newline at end of file diff --git a/hack/release.sh b/hack/release.sh index 0ec617e992d1..42ad565bff2f 100755 --- a/hack/release.sh +++ b/hack/release.sh @@ -15,15 +15,27 @@ elif [[ "$( git rev-parse "${tag}" )" != "$( git rev-parse HEAD )" ]]; then fi commit="$( git rev-parse ${tag} )" +export OS_GIT_COMMIT="${commit}" export OS_GIT_TREE_STATE=clean export OS_BUILD_ENV_PRESERVE=_output/local/releases # Build images and push to the hub -if [[ -z "${1-}" || "${1-}" == "images" ]]; then +if [[ -z "${1-}" || "${1-}" == "base" ]]; then # Ensure that the build is using the latest release image docker pull "${OS_BUILD_ENV_IMAGE}" hack/build-base-images.sh - hack/env OS_GIT_COMMIT="${commit}" make build-images +fi + +# Build images and push to the hub +if [[ -z "${1-}" || "${1-}" == "rpms" ]]; then + # Ensure that the build is using the latest release image + hack/env make build-rpms +fi + +# Build images and push to the hub +if [[ -z "${1-}" || "${1-}" == "images" ]]; then + # Ensure that the build is using the latest release image + hack/env make build-images -o build-rpms OS_PUSH_ALWAYS=1 OS_PUSH_TAG="${tag}" OS_TAG="" OS_PUSH_LOCAL="1" hack/push-release.sh fi