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: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ docker-publish: quay-login docker-build docker-push
## This target is run by the master branch Jenkins Job
.PHONY: build-push
build-push: docker-publish
CONTAINER_ENGINE="${CONTAINER_ENGINE}" \
@echo "## Building bundle and catalog images..."
@(CONTAINER_ENGINE="${CONTAINER_ENGINE}" \
CONTAINER_ENGINE_CONFIG_DIR="${CONTAINER_ENGINE_CONFIG_DIR}" \
CURRENT_COMMIT="${CURRENT_COMMIT}" \
OLM_BUNDLE_IMAGE="${OLM_BUNDLE_IMAGE}" \
Expand All @@ -102,4 +103,7 @@ build-push: docker-publish
OPERATOR_VERSION="${OPERATOR_VERSION}" \
OPERATOR_IMAGE="${OPERATOR_IMAGE}" \
OPERATOR_IMAGE_TAG="${OPERATOR_IMAGE_TAG}" \
build/build_opm_catalog.sh
IMAGE_REGISTRY=${IMAGE_REGISTRY} \
REGISTRY_USER="${REGISTRY_USER}" \
REGISTRY_TOKEN="${REGISTRY_TOKEN}" \
build/build_opm_catalog.sh)
10 changes: 9 additions & 1 deletion build/build_opm_catalog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ function precheck_required_files() {
return 0
}

function login_image_registry() {
${CONTAINER_ENGINE} login -u="${REGISTRY_USER}" -p="${REGISTRY_TOKEN}" ${IMAGE_REGISTRY}
}

function prepare_temporary_folders() {
BASE_FOLDER=$(mktemp -d --suffix "-$(basename "$0")")
DIR_BUNDLE=$(mktemp -d -p "$BASE_FOLDER" bundle.XXXX)
Expand Down Expand Up @@ -87,6 +91,10 @@ function set_previous_operator_version() {
}

function setup_environment() {
log "Login Image registry"
login_image_registry
log " Successfully login to $IMAGE_REGISTRY"

log "Generating temporary folders to contain artifacts"
prepare_temporary_folders
log " base path: $BASE_FOLDER"
Expand Down Expand Up @@ -221,7 +229,7 @@ function tag_and_push_images() {

function main() {
log "Building $OPERATOR_NAME version $OPERATOR_VERSION"

precheck_required_files || return 1

setup_environment
Expand Down