Skip to content

Commit

Permalink
Break release into pieces, build images in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
smarterclayton committed Aug 29, 2017
1 parent 3777cfb commit fdbd3dc
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 21 deletions.
46 changes: 27 additions & 19 deletions hack/build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
( os::build::image "openshift/hello-openshift" examples/hello-openshift ) &
16 changes: 14 additions & 2 deletions hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fdbd3dc

Please sign in to comment.