Skip to content

Commit

Permalink
ROX-20694: Use app-interface image tag pattern for all the images (#1452
Browse files Browse the repository at this point in the history
)
  • Loading branch information
kovayur authored Nov 8, 2023
1 parent 4d07b74 commit 0a4399f
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 47 deletions.
17 changes: 3 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,10 @@ SHELL = bash
binary:=fleet-manager

# The image tag for building and pushing comes from TAG environment variable by default.
# If there is no TAG env than CI_TAG is used instead.
# Otherwise image tag is generated based on git tags.
# Otherwise image tag is generated based on current commit hash.
# The version should be a 7-char hash from git. This is what the deployment process in app-interface expects.
ifeq ($(TAG),)
ifeq (,$(wildcard CI_TAG))
ifeq ($(IGNORE_REPOSITORY_DIRTINESS),true)
TAG=$(shell git describe --tags --abbrev=10 --long)
else
TAG=$(shell git describe --tags --abbrev=10 --dirty --long)
endif
else
TAG=$(shell cat CI_TAG)
endif
TAG=$(shell git rev-parse --short=7 HEAD)
endif
image_tag = $(TAG)

Expand Down Expand Up @@ -50,9 +42,6 @@ probe_image_repository:=$(PROBE_IMAGE_NAME)
external_image_registry:= $(IMAGE_REGISTRY)
internal_image_registry:=image-registry.openshift-image-registry.svc:5000

# Test image name that will be used for PR checks
test_image:=test/$(IMAGE_NAME)

DOCKER ?= docker
DOCKER_CONFIG ?= "${HOME}/.docker"

Expand Down
1 change: 0 additions & 1 deletion build_push_fleet_manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ make \
DOCKER_CONFIG="${DOCKER_CONFIG}" \
QUAY_USER="${QUAY_USER}" \
QUAY_TOKEN="${QUAY_TOKEN}" \
TAG="${VERSION}" \
external_image_registry="quay.io" \
internal_image_registry="quay.io" \
image_repository="${IMAGE_REPOSITORY}" \
Expand Down
1 change: 0 additions & 1 deletion build_push_probe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ make \
DOCKER_CONFIG="${DOCKER_CONFIG}" \
QUAY_PROBE_USER="${QUAY_USER}" \
QUAY_PROBE_TOKEN="${QUAY_TOKEN}" \
TAG="${VERSION}" \
external_image_registry="quay.io" \
internal_image_registry="quay.io" \
probe_image_repository="${IMAGE_REPOSITORY}" \
Expand Down
12 changes: 6 additions & 6 deletions deploy/helm/probe/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
ROOT_DIR="$SCRIPT_DIR/../../.."

# shellcheck source=scripts/lib/external_config.sh
source "$SCRIPT_DIR/../../../scripts/lib/external_config.sh"
source "$ROOT_DIR/scripts/lib/external_config.sh"
# shellcheck source=scripts/lib/helm.sh
source "$SCRIPT_DIR/../../../scripts/lib/helm.sh"
source "$ROOT_DIR/scripts/lib/helm.sh"

if [[ $# -ne 2 ]]; then
echo "Usage: $0 [environment] [cluster]" >&2
Expand All @@ -19,8 +20,7 @@ ENVIRONMENT=$1
CLUSTER_NAME=$2
PROBE_IMAGE_ORG="rhacs-eng"
PROBE_IMAGE_NAME="blackbox-monitoring-probe-service"
# Get HEAD for both main and production. This is the latest merged commit.
PROBE_IMAGE_TAG="$(git rev-parse --short=7 HEAD)"
PROBE_IMAGE_TAG="$(make -C "${ROOT_DIR}" tag)"
PROBE_IMAGE="quay.io/${PROBE_IMAGE_ORG}/${PROBE_IMAGE_NAME}:${PROBE_IMAGE_TAG}"

init_chamber
Expand Down Expand Up @@ -57,9 +57,9 @@ if [[ $CLUSTER_ENVIRONMENT != "$ENVIRONMENT" ]]; then
fi

if [[ "${HELM_DRY_RUN:-}" == "true" ]]; then
"${SCRIPT_DIR}/../../../scripts/check_image_exists.sh" "${PROBE_IMAGE_ORG}" "${PROBE_IMAGE_NAME}" "${PROBE_IMAGE_TAG}" 0 || echo >&2 "Ignoring failed image check in dry-run mode."
"${ROOT_DIR}/scripts/check_image_exists.sh" "${PROBE_IMAGE_ORG}" "${PROBE_IMAGE_NAME}" "${PROBE_IMAGE_TAG}" 0 || echo >&2 "Ignoring failed image check in dry-run mode."
else
"${SCRIPT_DIR}/../../../scripts/check_image_exists.sh" "${PROBE_IMAGE_ORG}" "${PROBE_IMAGE_NAME}" "${PROBE_IMAGE_TAG}"
"${ROOT_DIR}/scripts/check_image_exists.sh" "${PROBE_IMAGE_ORG}" "${PROBE_IMAGE_NAME}" "${PROBE_IMAGE_TAG}"
fi

load_external_config "cluster-${CLUSTER_NAME}" CLUSTER_
Expand Down
1 change: 0 additions & 1 deletion dev/env/defaults/00-defaults.env
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export CENTRAL_VERSION_DEFAULT=$(echo "$STACKROX_VERSION_TAG" | sed -e 's/0-nigh
export SCANNER_VERSION_DEFAULT="2.30.0" # This one matches the above operator version tag.
export STACKROX_OPERATOR_NAMESPACE_DEFAULT="rhacs"
export FLEET_MANAGER_IMAGE_DEFAULT=""
export IGNORE_REPOSITORY_DIRTINESS_DEFAULT="false"
export ENABLE_DB_PORT_FORWARDING_DEFAULT="false"
export ENABLE_FM_PORT_FORWARDING_DEFAULT="false"
export OPENSHIFT_MARKETPLACE_DEFAULT="false"
Expand Down
2 changes: 0 additions & 2 deletions dev/env/scripts/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ init() {
export ENABLE_CENTRAL_EXTERNAL_CERTIFICATE=${ENABLE_CENTRAL_EXTERNAL_CERTIFICATE:-$ENABLE_CENTRAL_EXTERNAL_CERTIFICATE_DEFAULT}
export CENTRAL_DOMAIN_NAME=${CENTRAL_DOMAIN_NAME:-$CENTRAL_DOMAIN_NAME_DEFAULT}
export FLEET_MANAGER_IMAGE=${FLEET_MANAGER_IMAGE:-$FLEET_MANAGER_IMAGE_DEFAULT}
export IGNORE_REPOSITORY_DIRTINESS=${IGNORE_REPOSITORY_DIRTINESS:-$IGNORE_REPOSITORY_DIRTINESS_DEFAULT}
export RHACS_TARGETED_OPERATOR_UPGRADES=${RHACS_TARGETED_OPERATOR_UPGRADES:-$RHACS_TARGETED_OPERATOR_UPGRADES_DEFAULT}
export RHACS_GITOPS_ENABLED=${RHACS_GITOPS_ENABLED:-$RHACS_GITOPS_ENABLED_DEFAULT}

Expand Down Expand Up @@ -229,7 +228,6 @@ SKIP_TESTS: ${SKIP_TESTS}
ENABLE_CENTRAL_EXTERNAL_CERTIFICATE: ${ENABLE_CENTRAL_EXTERNAL_CERTIFICATE}
CENTRAL_DOMAIN_NAME: ${CENTRAL_DOMAIN_NAME}
FLEET_MANAGER_IMAGE: ${FLEET_MANAGER_IMAGE}
IGNORE_REPOSITORY_DIRTINESS: ${IGNORE_REPOSITORY_DIRTINESS}
RHACS_TARGETED_OPERATOR_UPGRADES: ${RHACS_TARGETED_OPERATOR_UPGRADES}
RHACS_GITOPS_ENABLED: ${RHACS_GITOPS_ENABLED}
FLEET_MANAGER_CONTAINER_COMMAND: ${FLEET_MANAGER_CONTAINER_COMMAND}
Expand Down
8 changes: 1 addition & 7 deletions dev/env/scripts/up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,11 @@ else
export CHAMBER_SECRET_BACKEND=null
fi

if [[ "$IGNORE_REPOSITORY_DIRTINESS" = "true" ]]; then
fleet_manager_image_info="${FLEET_MANAGER_IMAGE} (ignoring repository dirtiness)"
else
fleet_manager_image_info="${FLEET_MANAGER_IMAGE}"
fi

cat <<EOF
** Bringing up ACSCS **
Image: ${fleet_manager_image_info}
Image: ${FLEET_MANAGER_IMAGE}
Cluster Name: ${CLUSTER_NAME}
Cluster Type: ${CLUSTER_TYPE}
Namespace: ${ACSCS_NAMESPACE}
Expand Down
12 changes: 6 additions & 6 deletions dp-terraform/helm/rhacs-terraform/terraform_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
ROOT_DIR="$SCRIPT_DIR/../../.."

# shellcheck source=scripts/lib/external_config.sh
source "$SCRIPT_DIR/../../../scripts/lib/external_config.sh"
source "$ROOT_DIR/scripts/lib/external_config.sh"
# shellcheck source=scripts/lib/helm.sh
source "$SCRIPT_DIR/../../../scripts/lib/helm.sh"
source "$ROOT_DIR/scripts/lib/helm.sh"

if [[ $# -ne 2 ]]; then
echo "Usage: $0 [environment] [cluster]" >&2
Expand Down Expand Up @@ -116,13 +117,12 @@ fi

FLEETSHARD_SYNC_ORG="app-sre"
FLEETSHARD_SYNC_IMAGE="acs-fleet-manager"
# Get HEAD for both main and production. This is the latest merged commit.
FLEETSHARD_SYNC_TAG="$(git rev-parse --short=7 HEAD)"
FLEETSHARD_SYNC_TAG="$(make -C "${ROOT_DIR}" tag)"

if [[ "${HELM_DRY_RUN:-}" == "true" ]]; then
"${SCRIPT_DIR}/../../../scripts/check_image_exists.sh" "${FLEETSHARD_SYNC_ORG}" "${FLEETSHARD_SYNC_IMAGE}" "${FLEETSHARD_SYNC_TAG}" 0 || echo >&2 "Ignoring failed image check in dry-run mode."
"${ROOT_DIR}/scripts/check_image_exists.sh" "${FLEETSHARD_SYNC_ORG}" "${FLEETSHARD_SYNC_IMAGE}" "${FLEETSHARD_SYNC_TAG}" 0 || echo >&2 "Ignoring failed image check in dry-run mode."
else
"${SCRIPT_DIR}/../../../scripts/check_image_exists.sh" "${FLEETSHARD_SYNC_ORG}" "${FLEETSHARD_SYNC_IMAGE}" "${FLEETSHARD_SYNC_TAG}"
"${ROOT_DIR}/scripts/check_image_exists.sh" "${FLEETSHARD_SYNC_ORG}" "${FLEETSHARD_SYNC_IMAGE}" "${FLEETSHARD_SYNC_TAG}"
fi

echo "Loading external config: audit-logs/${CLUSTER_NAME}"
Expand Down
10 changes: 5 additions & 5 deletions dp-terraform/ocm/install_addon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
ROOT_DIR="$SCRIPT_DIR/../.."

# shellcheck source=scripts/lib/external_config.sh
source "$SCRIPT_DIR/../../scripts/lib/external_config.sh"
source "$ROOT_DIR/scripts/lib/external_config.sh"

if [[ $# -ne 2 ]]; then
echo "Usage: $0 [environment] [cluster]" >&2
Expand Down Expand Up @@ -89,13 +90,12 @@ fi

FLEETSHARD_SYNC_ORG="app-sre"
FLEETSHARD_SYNC_IMAGE="acs-fleet-manager"
# Get HEAD for both main and production. This is the latest merged commit.
FLEETSHARD_SYNC_TAG="$(git rev-parse --short=7 HEAD)"
FLEETSHARD_SYNC_TAG="$(make -C "${ROOT_DIR}" tag)"

if [[ "${ADDON_DRY_RUN:-}" == "true" ]]; then
"${SCRIPT_DIR}/../../scripts/check_image_exists.sh" "${FLEETSHARD_SYNC_ORG}" "${FLEETSHARD_SYNC_IMAGE}" "${FLEETSHARD_SYNC_TAG}" 0 || echo >&2 "Ignoring failed image check in dry-run mode."
"${ROOT_DIR}/scripts/check_image_exists.sh" "${FLEETSHARD_SYNC_ORG}" "${FLEETSHARD_SYNC_IMAGE}" "${FLEETSHARD_SYNC_TAG}" 0 || echo >&2 "Ignoring failed image check in dry-run mode."
else
"${SCRIPT_DIR}/../../scripts/check_image_exists.sh" "${FLEETSHARD_SYNC_ORG}" "${FLEETSHARD_SYNC_IMAGE}" "${FLEETSHARD_SYNC_TAG}"
"${ROOT_DIR}/scripts/check_image_exists.sh" "${FLEETSHARD_SYNC_ORG}" "${FLEETSHARD_SYNC_IMAGE}" "${FLEETSHARD_SYNC_TAG}"
fi

echo "Loading external config: audit-logs/${CLUSTER_NAME}"
Expand Down
4 changes: 0 additions & 4 deletions scripts/build_setup.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#!/bin/bash -e

# The version should be a 7-char hash from git. This is what the deployment process in app-interface expects.
VERSION=$(git rev-parse --short=7 HEAD)
export VERSION

# Set the directory for docker configuration:
export DOCKER_CONFIG="${PWD}/.docker"

Expand Down

0 comments on commit 0a4399f

Please sign in to comment.