Skip to content

Commit

Permalink
fix(build): add missing buildxpush script
Browse files Browse the repository at this point in the history
Signed-off-by: kmova <[email protected]>
  • Loading branch information
kmova committed Dec 16, 2020
1 parent f18a8e3 commit e3a6a55
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile.buildx.mk
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ docker.buildx.provisioner:

.PHONY: buildx.push.provisioner
buildx.push.provisioner:
BUILDX=true DIMAGE=${IMAGE_ORG}/openebs-k8s-provisioner ./buildxpush
BUILDX=true DIMAGE=${IMAGE_ORG}/openebs-k8s-provisioner ./buildscripts/buildxpush
47 changes: 47 additions & 0 deletions buildscripts/buildxpush
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

# Copyright 2020 The OpenEBS Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -e

if [ -z ${DIMAGE} ];
then
echo "Error: DIMAGE is not specified";
exit 1
fi

function pushBuildx() {
BUILD_TAG="latest"
TARGET_IMG=${DIMAGE}

# TODO Currently ci builds with commit tag will not be generated,
# since buildx does not support multiple repo
# if not a release build set the tag and ci image
if [ -z "${RELEASE_TAG}" ]; then
return
# BUILD_ID=$(git describe --tags --always)
# BUILD_TAG="${BRANCH}-${BUILD_ID}"
# TARGET_IMG="${DIMAGE}-ci"
fi

echo "Tagging and pushing ${DIMAGE}:${TAG} as ${TARGET_IMG}:${BUILD_TAG}"
docker buildx imagetools create "${DIMAGE}:${TAG}" -t "${TARGET_IMG}:${BUILD_TAG}"
}

# if the push is for a buildx build
if [[ ${BUILDX} ]]; then
pushBuildx
exit 0
fi

0 comments on commit e3a6a55

Please sign in to comment.