f2620b99 |
#!/bin/bash
# This script builds and pushes a release to DockerHub. |
614bf6cc |
source "$(dirname "${BASH_SOURCE}")/lib/init.sh" |
f2620b99 |
|
0e50f40e |
tag="${OS_TAG:-}"
if [[ -z "${tag}" ]]; then
if [[ "$( git tag --points-at HEAD | wc -l )" -ne 1 ]]; then
os::log::error "Specify OS_TAG or ensure the current git HEAD is tagged." |
ac7a99ad |
exit 1
fi |
0e50f40e |
tag="$( git tag --points-at HEAD )"
elif [[ "$( git rev-parse "${tag}" )" != "$( git rev-parse HEAD )" ]]; then |
c24f5fef |
os::log::warn "You are running a version of hack/release.sh that does not match OS_TAG - images may not be build correctly" |
ac7a99ad |
fi |
9a094baa |
commit="$( git rev-parse ${tag} )" |
f2620b99 |
|
8ec3bfc8 |
function removeimage() {
for i in $@; do
if docker inspect $i &>/dev/null; then
docker rmi $i
fi
if docker inspect docker.io/$i &>/dev/null; then
docker rmi docker.io/$i
fi
done
}
|
0e50f40e |
# Ensure that the build is using the latest public base images |
8ec3bfc8 |
removeimage openshift/origin-base openshift/origin-release openshift/origin-haproxy-router-base |
f2620b99 |
docker pull openshift/origin-base
docker pull openshift/origin-release
docker pull openshift/origin-haproxy-router-base
|
9a094baa |
OS_GIT_COMMIT="${commit}" hack/build-release.sh |
f2620b99 |
hack/build-images.sh
OS_PUSH_TAG="${tag}" OS_TAG="" OS_PUSH_LOCAL="1" hack/push-release.sh
echo
echo "Pushed ${tag} to DockerHub"
echo "1. Push tag to GitHub with: git push origin --tags # (ensure you have no extra tags in your environment)"
echo "2. Create a new release on the releases page and upload the built binaries in _output/local/releases"
echo "3. Send an email" |