Files
my-rook-config/tests/scripts/build-release.sh
T
subhamkrai 4683254419 ci: push build images to Docker hub using gh action
We are moving towards github action.
This commit allows pushing build images
to Docker hub using gh action for master
build similar to what Jenkins does.

And, also removing `Publish if Master` step
from the Jenkinsfil file.

Signed-off-by: subhamkrai <srai@redhat.com>
2021-05-06 12:45:24 +05:30

30 lines
1.3 KiB
Bash

#!/usr/bin/env bash
set -ex
#############
# FUNCTIONS #
#############
function build() {
# set VERSION to a dummy value since Jenkins normally sets it for us. Do this to make Helm happy and not fail with "Error: Invalid Semantic Version"
build/run make VERSION=0 build.all
# quick check that go modules are tidied
build/run make mod.check
}
if [[ ${BRANCH_NAME} =~ release- ]]; then
build
build/run make -C build/release build BRANCH_NAME=${BRANCH_NAME} TAG_WITH_SUFFIX=true GIT_API_TOKEN=${GIT_PSW}
git status &
git diff &
build/run make -C build/release publish BRANCH_NAME=${BRANCH_NAME} TAG_WITH_SUFFIX=true AWS_ACCESS_KEY_ID=${AWS_USR} AWS_SECRET_ACCESS_KEY=${AWS_PSW} GIT_API_TOKEN=${GIT_PSW}
elif [[ ${BRANCH_NAME} =~ master|tag ]]; then
build
build/run make -C build/release build BRANCH_NAME=${BRANCH_NAME} GIT_API_TOKEN=${GIT_PSW}
git status &
git diff &
build/run make -C build/release publish BRANCH_NAME=${BRANCH_NAME} AWS_ACCESS_KEY_ID=${AWS_USR} AWS_SECRET_ACCESS_KEY=${AWS_PSW} GIT_API_TOKEN=${GIT_PSW}
# automatically promote the master builds
build/run make -C build/release promote BRANCH_NAME=master CHANNEL=master AWS_ACCESS_KEY_ID=${AWS_USR} AWS_SECRET_ACCESS_KEY=${AWS_PSW}
fi