Skip to content

Commit

Permalink
Merge pull request #13394 from smarterclayton/backport_rel
Browse files Browse the repository at this point in the history
Backport some 1.5 release fixes
  • Loading branch information
smarterclayton authored Mar 16, 2017
2 parents 4bdf7ce + c6c0291 commit 0eb20f4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
20 changes: 8 additions & 12 deletions hack/build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,25 @@ function image-build() {
local tag=$1
local dir=$2
local dest="${tag}"
local extra=
if [[ ! "${tag}" == *":"* ]]; then
dest="${tag}:latest"
# tag to release commit unless we specified a hardcoded tag
extra="${tag}:${OS_RELEASE_COMMIT}"
fi

local STARTTIME
local ENDTIME
STARTTIME="$(date +%s)"

# build the image
if ! os::build::image "${dir}" "${dest}"; then
os::log::warn "Retrying build once"
os::build::image "${dir}" "${dest}"
if ! os::build::image "${dir}" "${dest}" "" "${extra}"; then
os::log::warning "Retrying build once"
if ! os::build::image "${dir}" "${dest}" "" "${extra}"; then
return 1
fi
fi

# tag to release commit unless we specified a hardcoded tag
if [[ ! "${tag}" == *":"* ]]; then
docker tag "${dest}" "${tag}:${OS_RELEASE_COMMIT}"
fi
# ensure the temporary contents are cleaned up
git clean -fdx "${dir}"

Expand Down Expand Up @@ -149,11 +150,6 @@ image openshift/deployment-example:v1 examples/deployment
ln_or_cp "${imagedir}/deployment" examples/deployment/bin
image openshift/deployment-example:v2 examples/deployment examples/deployment/Dockerfile.v2

echo
echo
echo "++ Active images"

docker images | grep openshift/ | grep ${OS_RELEASE_COMMIT} | sort
echo

ret=$?; ENDTIME=$(date +%s); echo "$0 took $(($ENDTIME - $STARTTIME)) seconds"; exit "$ret"
14 changes: 12 additions & 2 deletions hack/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -726,16 +726,20 @@ function os::build::image() {
local directory=$1
local tag=$2
local dockerfile="${3-}"
local extra_tag="${4-}"
local options="${OS_BUILD_IMAGE_ARGS-}"
local mode="${OS_BUILD_IMAGE_TYPE:-imagebuilder}"

if [[ "${mode}" == "imagebuilder" ]]; then
if os::util::find::system_binary 'imagebuilder'; then
if [[ -n "${extra_tag}" ]]; then
extra_tag="-t '${extra_tag}'"
fi
if [[ -n "${dockerfile}" ]]; then
eval "imagebuilder -f '${dockerfile}' -t '${tag}' ${options} '${directory}'"
eval "imagebuilder -f '${dockerfile}' -t '${tag}' ${extra_tag} ${options} '${directory}'"
return $?
fi
eval "imagebuilder -t '${tag}' ${options} '${directory}'"
eval "imagebuilder -t '${tag}' ${extra_tag} ${options} '${directory}'"
return $?
fi

Expand All @@ -746,9 +750,15 @@ function os::build::image() {

if [[ -n "${dockerfile}" ]]; then
eval "docker build -f '${dockerfile}' -t '${tag}' ${options} '${directory}'"
if [[ -n "${extra_tag}" ]]; then
docker tag "${tag}" "${extra_tag}"
fi
return $?
fi
eval "docker build -t '${tag}' ${options} '${directory}'"
if [[ -n "${extra_tag}" ]]; then
docker tag "${tag}" "${extra_tag}"
fi
return $?
}
readonly -f os::build::image
Expand Down
4 changes: 2 additions & 2 deletions hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ elif [[ "$( git rev-parse "${tag}" )" != "$( git rev-parse HEAD )" ]]; then
fi
commit="$( git rev-parse ${tag} )"

# Ensure that the build is using the latest public base images
docker pull "openshift/origin-base:latest"
# Ensure that the build is using the latest release image
docker pull "${OS_BUILD_ENV_IMAGE}"

hack/build-base-images.sh
OS_GIT_COMMIT="${commit}" hack/build-release.sh
hack/build-images.sh
OS_PUSH_TAG="${tag}" OS_TAG="" OS_PUSH_LOCAL="1" hack/push-release.sh
Expand Down

0 comments on commit 0eb20f4

Please sign in to comment.