Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions hack/build-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ GOARCH=${GOACH:-${GOHOSTARCH}}
# Go to the root of the repo
cd "$(git rev-parse --show-cdup)"

if [ -z ${VERSION+a} ]; then
if [ -z ${VERSION_OVERRIDE+a} ]; then
echo "Using version from git..."
VERSION=$(git describe --abbrev=8 --dirty --always)
VERSION_OVERRIDE=$(git describe --abbrev=8 --dirty --always)
fi

GLDFLAGS+="-X ${REPO}/pkg/version.Raw=${VERSION}"
GLDFLAGS+="-X ${REPO}/pkg/version.Raw=${VERSION_OVERRIDE}"

eval $(go env)

Expand All @@ -29,5 +29,5 @@ fi

mkdir -p ${BIN_PATH}

echo "Building ${REPO} (${VERSION})"
echo "Building ${REPO} (${VERSION_OVERRIDE})"
CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build ${GOFLAGS} -ldflags "${GLDFLAGS}" -o ${BIN_PATH}/cluster-version-operator ${REPO}/cmd/...
6 changes: 3 additions & 3 deletions hack/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ if [ `id --user` -ne 0 ]; then
print_error "Note: Building unprivileged may fail due to permissions"
fi

if [ -z ${VERSION+a} ]; then
if [ -z ${VERSION_OVERRIDE+a} ]; then
print_info "Using version from git..."
VERSION=$(git describe --abbrev=8 --dirty --always)
VERSION_OVERRIDE=$(git describe --abbrev=8 --dirty --always)
fi

set -x
podman build -t "cluster-version-operator:${VERSION}" -f Dockerfile --no-cache
podman build -t "cluster-version-operator:${VERSION_OVERRIDE}" -f Dockerfile --no-cache
8 changes: 4 additions & 4 deletions hack/push-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ function print_info {

REPO=${REPO:-"openshift"}

if [ -z ${VERSION+a} ]; then
if [ -z ${VERSION_OVERRIDE+a} ]; then
print_info "Using version from git..."
VERSION=$(git describe --abbrev=8 --dirty --always)
VERSION_OVERRIDE=$(git describe --abbrev=8 --dirty --always)
fi

set -x
podman push "cluster-version-operator:${VERSION}" "${REPO}/origin-cluster-version-operator:${VERSION}"
podman push "cluster-version-operator:${VERSION}" "${REPO}/origin-cluster-version-operator:latest"
podman push "cluster-version-operator:${VERSION_OVERRIDE}" "${REPO}/origin-cluster-version-operator:${VERSION_OVERRIDE}"
podman push "cluster-version-operator:${VERSION_OVERRIDE}" "${REPO}/origin-cluster-version-operator:latest"