Skip to content

Commit

Permalink
Step three in creating local releases. (istio#15074)
Browse files Browse the repository at this point in the history
* Local build

* Local build

* Fix shell

* Add docker_tag

* Fix lint

* Removing some dups

* License

* License

* License

* Push images to docker hub
  • Loading branch information
utka authored and istio-testing committed Jun 22, 2019
1 parent 8c0f2c6 commit f881451
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
5 changes: 4 additions & 1 deletion release/gcb/docker_tag_push_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ function docker_push_images() {
local OUT_PATH
OUT_PATH="$3"
echo "pushing to ${DST_HUB}/image:${DST_TAG}"
add_docker_creds "${DST_HUB}"

if [ -z "${LOCAL_BUILD+x}" ]; then
add_docker_creds "${DST_HUB}"
fi

for TAR_PATH in "${OUT_PATH}"/docker/*.tar.gz; do
BASE_NAME=$(basename "$TAR_PATH")
Expand Down
15 changes: 12 additions & 3 deletions release/gcb/local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@ set -o errexit
source gcb_lib.sh
ROOT=$(cd "$(git rev-parse --show-cdup)" && pwd || return)
artifacts="$HOME/output/local"
export NEW_VERSION="fake"
export DOCKER_HUB='docker.io/fake'
export NEW_VERSION=${TAG:-}
export DOCKER_HUB=${DOCKER_HUB:-}
if [ -z "${NEW_VERSION}" ]; then
echo "Provide or export the tag for the images. TAG=my_amazing_tag."
exit 1
fi
if [ -z "${DOCKER_HUB}" ]; then
echo "Provide or export the docker hub. DOCKER_HUB=docker.io/my_awesome_hub."
exit 1
fi
GOPATH=$(cd "$ROOT/../../.." && pwd)
LOCAL_BUILD=true
export LOCAL_BUILD
Expand All @@ -18,7 +26,6 @@ CURRENT_BRANCH=$(git symbolic-ref --short HEAD)
BRANCH=${BRANCH:-$CURRENT_BRANCH}
export BRANCH
export CB_VERIFY_CONSISTENCY=true

echo "Delete old builds"
rm -r "${artifacts}" || echo
mkdir -p "${artifacts}"
Expand All @@ -33,3 +40,5 @@ pushd "${ROOT}" || exit
make_istio "${artifacts}" "${DOCKER_HUB}" "${DOCKER_HUB}" "${NEW_VERSION}" "${BRANCH}"
popd || return

docker_tag_images "${DOCKER_HUB}" "${NEW_VERSION}" "${artifacts}"
docker_push_images "${DOCKER_HUB}" "${NEW_VERSION}" "${artifacts}"

0 comments on commit f881451

Please sign in to comment.