diff --git a/Common.mk b/Common.mk index e52224b4b2..03b21b6d7e 100644 --- a/Common.mk +++ b/Common.mk @@ -200,6 +200,8 @@ HELM_DESTINATION_REPOSITORY?=$(IMAGE_COMPONENT) HELM_IMAGE_LIST?= HELM_GIT_CHECKOUT_TARGET?=$(HELM_SOURCE_REPOSITORY)/eks-anywhere-checkout-$(HELM_GIT_TAG) HELM_GIT_PATCH_TARGET?=$(HELM_SOURCE_REPOSITORY)/eks-anywhere-helm-patched +PACKAGE_DEPENDENCIES?= +FORCE_JSON_SCHEMA_FILE?= #################################################### #### HELPERS ######## @@ -799,17 +801,25 @@ binary-builder/cgo/%: USE_DOCKER_FOR_CGO_BUILD=$(shell command -v docker &> /dev helm/pull: | $$(ENABLE_LOGGING) @$(BUILD_LIB)/helm_pull.sh $(HELM_PULL_LOCATION) $(HELM_REPO_URL) $(HELM_PULL_NAME) $(REPO) $(HELM_DIRECTORY) $(CHART_VERSION) $(COPY_CRDS) -# Build helm chart -.PHONY: helm/build -helm/build: $(LICENSES_TARGETS_FOR_PREREQ) -helm/build: $(if $(filter true,$(REPO_NO_CLONE)),,$(HELM_GIT_CHECKOUT_TARGET)) -helm/build: $(if $(wildcard $(PROJECT_ROOT)/helm/patches),$(HELM_GIT_PATCH_TARGET),) | ensure-helm ensure-skopeo - @echo -e $(call TARGET_START_LOG) - $(BUILD_LIB)/helm_copy.sh $(HELM_SOURCE_REPOSITORY) $(HELM_DESTINATION_REPOSITORY) $(HELM_DIRECTORY) $(OUTPUT_DIR) - $(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) $(HELM_IMAGE_LIST) - $(BUILD_LIB)/helm_replace.sh $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR) - $(BUILD_LIB)/helm_build.sh $(OUTPUT_DIR) $(HELM_DESTINATION_REPOSITORY) - @echo -e $(call TARGET_END_LOG) + +.PHONY: helm/copy helm/require helm/replace helm/build helm/push + +helm/copy: $(LICENSES_TARGETS_FOR_PREREQ) +helm/copy: $(if $(filter true,$(REPO_NO_CLONE)),,$(HELM_GIT_CHECKOUT_TARGET)) +helm/copy: $(if $(wildcard $(PROJECT_ROOT)/helm/patches),$(HELM_GIT_PATCH_TARGET),) | ensure-helm ensure-skopeo $$(ENABLE_LOGGING) + @$(BUILD_LIB)/helm_copy.sh $(HELM_SOURCE_REPOSITORY) $(HELM_DESTINATION_REPOSITORY) $(HELM_DIRECTORY) $(OUTPUT_DIR) + +helm/require: helm/copy | $$(ENABLE_LOGGING) + @$(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) "$(PACKAGE_DEPENDENCIES)" "$(FORCE_JSON_SCHEMA_FILE)" $(HELM_IMAGE_LIST) + +helm/replace: helm/require | $$(ENABLE_LOGGING) + @$(BUILD_LIB)/helm_replace.sh $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR) + +helm/build: helm/replace | $$(ENABLE_LOGGING) + @$(BUILD_LIB)/helm_build.sh $(OUTPUT_DIR) $(HELM_DESTINATION_REPOSITORY) + +helm/push: helm/build | $$(ENABLE_LOGGING) + @$(BUILD_LIB)/helm_push.sh $(IMAGE_REPO) $(HELM_DESTINATION_REPOSITORY) $(HELM_TAG) $(GIT_TAG) $(OUTPUT_DIR) $(LATEST) # Build helm chart and push to registry defined in IMAGE_REPO. .PHONY: helm/push diff --git a/build/lib/helm_build.sh b/build/lib/helm_build.sh index 6270d03988..c46a876edc 100755 --- a/build/lib/helm_build.sh +++ b/build/lib/helm_build.sh @@ -13,11 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -x set -o errexit set -o nounset set -o pipefail +SCRIPT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)" +source "${SCRIPT_ROOT}/common.sh" + OUTPUT_DIR="${1?First arguement is output directory}" HELM_DESTINATION_REPOSITORY="${2?Second argument is helm destination repository}" CHART_NAME=$(basename ${HELM_DESTINATION_REPOSITORY}) @@ -26,4 +28,4 @@ CHART_NAME=$(basename ${HELM_DESTINATION_REPOSITORY}) # Build # cd ${OUTPUT_DIR}/helm -helm package "${CHART_NAME}" +build::common::echo_and_run helm package "${CHART_NAME}" diff --git a/build/lib/helm_copy.sh b/build/lib/helm_copy.sh index 512e8e45de..a700cdf4b7 100755 --- a/build/lib/helm_copy.sh +++ b/build/lib/helm_copy.sh @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -x + set -o errexit set -o nounset set -o pipefail @@ -33,6 +33,6 @@ source "${SCRIPT_ROOT}/common.sh" # # Copy # -mkdir -p ${DEST_DIR} -rsync -a --exclude .git "${SOURCE_DIR}" "${DEST_DIR}" -build::non-golang::copy_licenses ${HELM_SOURCE_REPOSITORY} $DEST_DIR/LICENSES/github.com/${HELM_SOURCE_REPOSITORY} +build::common::echo_and_run mkdir -p ${DEST_DIR} +build::common::echo_and_run rsync -a --exclude .git "${SOURCE_DIR}" "${DEST_DIR}" +build::common::echo_and_run build::non-golang::copy_licenses ${HELM_SOURCE_REPOSITORY} $DEST_DIR/LICENSES/github.com/${HELM_SOURCE_REPOSITORY} diff --git a/build/lib/helm_push.sh b/build/lib/helm_push.sh index b8fd0cb314..6f8bdd338d 100755 --- a/build/lib/helm_push.sh +++ b/build/lib/helm_push.sh @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -x set -o errexit set -o nounset set -o pipefail @@ -47,26 +46,35 @@ export HELM_REGISTRY_CONFIG="${DOCKER_CONFIG}/config.json" export HELM_EXPERIMENTAL_OCI=1 TMPFILE=$(mktemp /tmp/helm-output.XXXXXX) function cleanup() { - if [[ "${IMAGE_REGISTRY}" == *"public.ecr.aws"* ]]; then - echo "If authentication failed: aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws" + if grep -q "blobs/uploads/\": EOF" $TMPFILE ; then + echo "******************************************************" + echo "Ensure container registry and repository exists!!" + echo "Try running make create-ecr-repos to create ecr repositories in your aws account." + echo "******************************************************" else - echo "If authentication failed: aws ecr get-login-password --region \${AWS_REGION} | docker login --username AWS --password-stdin ${IMAGE_REGISTRY}" + cat $TMPFILE + if [[ "${IMAGE_REGISTRY}" == *"public.ecr.aws"* ]]; then + echo "If authentication failed: aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws" + else + echo "If authentication failed: aws ecr get-login-password --region \${AWS_REGION} | docker login --username AWS --password-stdin ${IMAGE_REGISTRY}" + fi fi rm -f "${TMPFILE}" } trap cleanup err trap "rm -f $TMPFILE" exit -helm push ${CHART_FILE} oci://${IMAGE_REGISTRY}/${HELM_DESTINATION_OWNER} | tee ${TMPFILE} +echo "($(pwd)) \$ helm push ${CHART_FILE} oci://${IMAGE_REGISTRY}/${HELM_DESTINATION_OWNER}" +helm push ${CHART_FILE} oci://${IMAGE_REGISTRY}/${HELM_DESTINATION_OWNER} 2> ${TMPFILE} +DIGEST=$(grep Digest $TMPFILE | $SED -e 's/Digest: //') # Adds a 2nd tag to the helm chart for the bundle-release jobs. if [[ "${IMAGE_REGISTRY}" != *"public.ecr.aws"* ]]; then - MANIFEST=$(aws ecr batch-get-image --repository-name "$HELM_DESTINATION_REPOSITORY" --image-ids imageTag=${SEMVER} --query "images[].imageManifest" --output text) + MANIFEST=$(aws ecr batch-get-image --repository-name "$HELM_DESTINATION_REPOSITORY" --image-ids imageDigest=${DIGEST} --query "images[].imageManifest" --output text) export AWS_PAGER="" - aws ecr put-image --repository-name ${HELM_DESTINATION_REPOSITORY} --image-tag ${SEMVER_GIT_TAG}-${LATEST_TAG}-helm --image-manifest "$MANIFEST" --image-manifest-media-type "application/vnd.oci.image.manifest.v1+json" + build::common::echo_and_run aws ecr put-image --repository-name ${HELM_DESTINATION_REPOSITORY} --image-tag ${SEMVER_GIT_TAG}-${LATEST_TAG}-helm --image-manifest "$MANIFEST" --image-manifest-media-type "application/vnd.oci.image.manifest.v1+json" fi -DIGEST=$(grep Digest $TMPFILE | $SED -e 's/Digest: //') { set +x echo diff --git a/build/lib/helm_replace.sh b/build/lib/helm_replace.sh index 377799db99..0299c66853 100755 --- a/build/lib/helm_replace.sh +++ b/build/lib/helm_replace.sh @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -x set -o errexit set -o nounset set -o pipefail @@ -36,12 +35,12 @@ TEMPLATE_DIR=helm/templates SEDFILE=${OUTPUT_DIR}/helm/sedfile for file in Chart.yaml values.yaml do - $SED -f ${SEDFILE} -i ${DEST_DIR}/${file} + build::common::echo_and_run $SED -f ${SEDFILE} -i ${DEST_DIR}/${file} done if [ -d ${OUTPUT_DIR}/helm/${CHART_NAME}/crds ]; then for file in crds/*.yaml do - $SED -f ${SEDFILE} -i ${DEST_DIR}/${file} + build::common::echo_and_run $SED -f ${SEDFILE} -i ${DEST_DIR}/${file} done fi \ No newline at end of file diff --git a/build/lib/helm_require.sh b/build/lib/helm_require.sh index e82a201f83..999ce565eb 100755 --- a/build/lib/helm_require.sh +++ b/build/lib/helm_require.sh @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -x set -e set -o errexit set -o nounset @@ -27,13 +26,19 @@ HELM_TAG="${5?Fifth argument is helm tag}" PROJECT_ROOT="${6?Sixth argument is project root}" LATEST="${7?Seventh argument is latest tag}" HELM_USE_UPSTREAM_IMAGE="${8?Eigth argument is bool determining whether to use cached upstream images}" -HELM_IMAGE_LIST="${@:9}" +PACKAGE_DEPENDENCIES="${9?Ninth argument is optional project dependencies}" +FORCE_JSON_SCHEMA_FILE="${10?Tenth argument is optional schema file}" +HELM_IMAGE_LIST="${@:11}" CHART_NAME=$(basename ${HELM_DESTINATION_REPOSITORY}) DEST_DIR=${OUTPUT_DIR}/helm/${CHART_NAME} SCRIPT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)" -PACKAGE_DEPENDENCIES=${PACKAGE_DEPENDENCIES:=""} -FORCE_JSON_SCHEMA_FILE=${FORCE_JSON_SCHEMA_FILE:=""} +source "${SCRIPT_ROOT}/common.sh" + +if ! aws sts get-caller-identity &> /dev/null; then + echo "The AWS cli is used to find the ECR registries and repos for the current AWS account please login!" + exit 1; +fi # # Image tags @@ -52,40 +57,94 @@ JSON_SCHEMA_FILE=$PROJECT_ROOT/helm/schema.json SEDFILE=${OUTPUT_DIR}/helm/sedfile export IMAGE_TAG export HELM_TAG -export HELM_REGISTRY=$(aws ecr-public describe-registries --region us-east-1 --output text --query 'registries[*].registryUri') +export HELM_REGISTRY=$(aws ecr-public describe-registries --region us-east-1 --output text --query 'registries[*].registryUri' 2> /dev/null) envsubst <$PROJECT_ROOT/helm/sedfile.template >${SEDFILE} # Semver requires that our version begin with a digit, so strip the v. echo "s,version: v,version: ,g" >>${SEDFILE} -for IMAGE in ${HELM_IMAGE_LIST:-} -do - if [ "${IMAGE}" == "${HELM_DESTINATION_REPOSITORY}" ] || [ "${IMAGE_TAG}" != "${HELM_TAG}" ] - then + +# query ecr for the shasum of the image tagged with ${TAG} +function get_image_shasum() { + local -r image=$1 + local -r tag=$2 + + local image_shasum= + if [ "${HELM_USE_UPSTREAM_IMAGE}" = true ]; then + image_shasum=$(${SCRIPT_ROOT}/image_shasum.sh ${IMAGE_REGISTRY} ${image} ${tag}) + elif [ "${JOB_TYPE:-}" = "presubmit" ]; then + image_shasum=${LATEST} + fi + + if [[ -z ${image_shasum} ]] && aws --region us-east-1 ecr-public describe-repositories --repository-names ${image} &> /dev/null; then + image_shasum=$(build::common::echo_and_run ${SCRIPT_ROOT}/image_shasum.sh ${HELM_REGISTRY} ${image} ${tag}) + fi + + if [[ -z ${image_shasum} ]] && aws ecr describe-repositories --repository-names ${image} &> /dev/null; then + image_shasum=$(build::common::echo_and_run ${SCRIPT_ROOT}/image_shasum.sh ${IMAGE_REGISTRY} ${image} ${tag}) + fi + + if [[ -n ${image_shasum} ]]; then + echo ${image_shasum} + else + echo "${image} does not exist in ECR Public or Private" + exit 1 + fi +} + + # query ecr for the image by latest tag and find the first non-latest tag the image is also tagged with +function get_image_tag_not_latest() { + local -r image=$1 + local -r tag=$2 + + local use_tag= + if [ "${JOB_TYPE:-}" = "presubmit" ]; then + use_tag=${tag} + fi + + if [[ -z ${use_tag} ]] && aws --region us-east-1 ecr-public describe-repositories --repository-names ${image} &> /dev/null; then + use_tag=$(build::common::echo_and_run aws --region us-east-1 ecr-public describe-images --repository-name ${image} --image-ids imageTag=${tag} --query 'imageDetails[0].imageTags' --output yaml 2> /dev/null | grep -v ${tag} | head -1| sed -e 's/- //') + fi + + if [[ -z ${use_tag} ]] && aws ecr describe-repositories --repository-names ${image} &> /dev/null; then + use_tag=$(build::common::echo_and_run aws ecr describe-images --repository-name ${image} --image-id imageTag=${tag} --query 'imageDetails[0].imageTags' --output yaml 2> /dev/null | grep -v ${tag} | head -1| sed -e 's/- //') + fi + + if [[ -n ${use_tag} ]]; then + echo ${use_tag} + else + echo "${image}@${tag} does not exist in ECR Public or Private" + exit 1 + fi +} + +for IMAGE in ${HELM_IMAGE_LIST:-}; do + # if its the image(s) built from this project, use the image_tag + # otherwise its an image from a different project so use latest to trigger finding the latest image + if [ "${IMAGE}" = "${HELM_DESTINATION_REPOSITORY}" ] || [ "${IMAGE_TAG}" != "${HELM_TAG}" ]; then TAG="${IMAGE_TAG}" else TAG="${LATEST}" fi - IMAGE_SHASUM=$(${SCRIPT_ROOT}/image_shasum.sh ${HELM_REGISTRY} ${IMAGE} ${TAG}) || - IMAGE_SHASUM=$(${SCRIPT_ROOT}/image_shasum.sh ${IMAGE_REGISTRY} ${IMAGE} ${TAG}) + + IMAGE_SHASUM=$(get_image_shasum ${IMAGE} ${TAG}) + echo "s,{{${IMAGE}}},${IMAGE_SHASUM},g" >>${SEDFILE} - if [ "${TAG}" == "latest" ] - then - USE_TAG=$(aws --region us-east-1 ecr-public describe-images --repository-name ${IMAGE} --image-ids imageTag=latest --query 'imageDetails[0].imageTags' --output yaml | grep -v latest | head -1| sed -e 's/- //') || - USE_TAG=$(aws ecr describe-images --repository-name ${IMAGE} --image-id imageTag=latest --query 'imageDetails[0].imageTags' --output yaml | grep -v latest | head -1| sed -e 's/- //') || - USE_TAG="latest" + if [ "${TAG}" = "${LATEST}" ]; then + USE_TAG=$(get_image_tag_not_latest ${IMAGE} ${LATEST}) else USE_TAG=$TAG fi + # If HELM_USE_UPSTREAM_IMAGE is true, we are using images from upstream. # Though we pull images directly from upstream for build tooling checks (i.e. # get images shasums), we will use cached images in the helm charts. Cached # images follow the convention of ${PROJECT_NAME}/${UPSTREAM_IMAGE_NAME}. - if [ "${HELM_USE_UPSTREAM_IMAGE}" == true ] - then + if [ "${HELM_USE_UPSTREAM_IMAGE}" == true ]; then PROJECT_NAME=$(echo "$HELM_DESTINATION_REPOSITORY" | awk -F "/" '{print $1}') IMAGE_REPO="${PROJECT_NAME}/${IMAGE}" else IMAGE_REPO="${IMAGE}" fi + cat >>${REQUIRES_FILE} <>${REQUIRES_FILE} <> ${REQUIRES_FILE} fi + +build::common::echo_and_run cat ${SEDFILE} +build::common::echo_and_run cat ${REQUIRES_FILE} diff --git a/build/lib/image_shasum.sh b/build/lib/image_shasum.sh index 546d75cad6..69bfa75105 100755 --- a/build/lib/image_shasum.sh +++ b/build/lib/image_shasum.sh @@ -13,22 +13,26 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -x set -o errexit set -o nounset set -o pipefail +SCRIPT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)" +source "${SCRIPT_ROOT}/common.sh" + REGISTRY="${1?First argument is registry}" REPOSITORY="${2?Second argument is repository}" IMAGE_TAG="${3?Third argument is image tag}" -if [ "${JOB_TYPE:-}" == "presubmit" ] -then - echo latest - exit 0 -fi TMPFILE=$(mktemp) trap "rm -f $TMPFILE" exit TARGET=${REGISTRY}/${REPOSITORY}:${IMAGE_TAG} -skopeo inspect -n --raw docker://${TARGET} >${TMPFILE} -skopeo manifest-digest ${TMPFILE} + +>&2 echo -n "Checking for the existence of ${TARGET}..." +if skopeo inspect -n --raw docker://${TARGET} >${TMPFILE} 2>/dev/null; then + >&2 echo "Found!" + skopeo manifest-digest ${TMPFILE} +else + >&2 echo "Not Found!" +fi + diff --git a/projects/aws/eks-anywhere-packages/Makefile b/projects/aws/eks-anywhere-packages/Makefile index bb34ab05f4..6d286e7f85 100644 --- a/projects/aws/eks-anywhere-packages/Makefile +++ b/projects/aws/eks-anywhere-packages/Makefile @@ -58,23 +58,23 @@ helm/build: $(if $(filter true,$(REPO_NO_CLONE)),,$(HELM_GIT_CHECKOUT_TARGET)) helm/build: $(if $(wildcard $(PROJECT_ROOT)/helm/patches),$(HELM_GIT_PATCH_TARGET),) # Pkg controller requires multiple charts. Consider this a temporary work-around (turned too permanent). $(BUILD_LIB)/helm_copy.sh $(HELM_SOURCE_REPOSITORY) eks-anywhere-packages-migrations charts/eks-anywhere-packages-migrations $(OUTPUT_DIR) - $(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) eks-anywhere-packages-migrations $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) $(HELM_IMAGE_LIST) + $(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) eks-anywhere-packages-migrations $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) "$(PACKAGE_DEPENDENCIES)" "$(FORCE_JSON_SCHEMA_FILE)" $(HELM_IMAGE_LIST) $(BUILD_LIB)/helm_replace.sh eks-anywhere-packages-migrations $(OUTPUT_DIR) $(BUILD_LIB)/helm_build.sh $(OUTPUT_DIR) eks-anywhere-packages-migrations $(BUILD_LIB)/helm_copy.sh $(HELM_SOURCE_REPOSITORY) eks-anywhere-packages-crds charts/eks-anywhere-packages-crds $(OUTPUT_DIR) - PACKAGE_DEPENDENCIES=eks-anywhere-packages-migrations $(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) eks-anywhere-packages-crds $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) $(HELM_IMAGE_LIST) + $(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) eks-anywhere-packages-crds $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) eks-anywhere-packages-migrations "$(FORCE_JSON_SCHEMA_FILE)" $(HELM_IMAGE_LIST) $(BUILD_LIB)/helm_replace.sh eks-anywhere-packages-crds $(OUTPUT_DIR) $(BUILD_LIB)/helm_build.sh $(OUTPUT_DIR) eks-anywhere-packages-crds $(BUILD_LIB)/helm_copy.sh $(HELM_SOURCE_REPOSITORY) $(HELM_DESTINATION_REPOSITORY) $(HELM_DIRECTORY) $(OUTPUT_DIR) - PACKAGE_DEPENDENCIES=eks-anywhere-packages-crds $(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) $(HELM_IMAGE_LIST) + $(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) "eks-anywhere-packages-crds" "$(FORCE_JSON_SCHEMA_FILE)" $(HELM_IMAGE_LIST) $(BUILD_LIB)/helm_replace.sh $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR) $(BUILD_LIB)/helm_build.sh $(OUTPUT_DIR) $(HELM_DESTINATION_REPOSITORY) # Credential Provider Package lives in pkg controller repo. Workaround for its sepearate chart $(BUILD_LIB)/helm_copy.sh $(HELM_SOURCE_REPOSITORY) credential-provider-package credentialproviderpackage/charts/credential-provider-package $(OUTPUT_DIR) - FORCE_JSON_SCHEMA_FILE=$(PROJECT_ROOT)/helm/credential-provider-package.schema.json $(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) credential-provider-package $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) $(CRED_HELM_IMAGE_LIST) + $(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) credential-provider-package $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) "$(PACKAGE_DEPENDENCIES)" "$(PROJECT_ROOT)/helm/credential-provider-package.schema.json" $(CRED_HELM_IMAGE_LIST) $(BUILD_LIB)/helm_replace.sh credential-provider-package $(OUTPUT_DIR) $(BUILD_LIB)/helm_build.sh $(OUTPUT_DIR) credential-provider-package diff --git a/projects/emissary-ingress/emissary/Makefile b/projects/emissary-ingress/emissary/Makefile index d349e8b719..8f092e9d8a 100644 --- a/projects/emissary-ingress/emissary/Makefile +++ b/projects/emissary-ingress/emissary/Makefile @@ -43,11 +43,11 @@ $(AMBASSADOR_VERSION_TARGET): helm/build: $(if $(wildcard $(PROJECT_ROOT)/helm/patches),$(HELM_GIT_PATCH_TARGET),) # Emissary requires 2 charts. Consider this a temporary work-around. $(BUILD_LIB)/helm_copy.sh $(HELM_SOURCE_REPOSITORY) emissary/crds charts/crds $(OUTPUT_DIR) - $(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) emissary/crds $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) $(HELM_IMAGE_LIST) + $(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) emissary/crds $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) "$(PACKAGE_DEPENDENCIES)" "$(FORCE_JSON_SCHEMA_FILE)" $(HELM_IMAGE_LIST) $(BUILD_LIB)/helm_replace.sh emissary/crds $(OUTPUT_DIR) $(BUILD_LIB)/helm_build.sh $(OUTPUT_DIR) emissary/crds $(BUILD_LIB)/helm_copy.sh $(HELM_SOURCE_REPOSITORY) $(HELM_DESTINATION_REPOSITORY) $(HELM_DIRECTORY) $(OUTPUT_DIR) - PACKAGE_DEPENDENCIES=emissary-crds $(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) $(HELM_IMAGE_LIST) + $(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) emissary-crds "$(FORCE_JSON_SCHEMA_FILE)" $(HELM_IMAGE_LIST) $(BUILD_LIB)/helm_replace.sh $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR) $(BUILD_LIB)/helm_build.sh $(OUTPUT_DIR) $(HELM_DESTINATION_REPOSITORY) diff --git a/projects/metallb/metallb/Makefile b/projects/metallb/metallb/Makefile index 38667a841e..8dd19e9137 100644 --- a/projects/metallb/metallb/Makefile +++ b/projects/metallb/metallb/Makefile @@ -32,11 +32,11 @@ helm/build: $(if $(filter true,$(REPO_NO_CLONE)),,$(HELM_GIT_CHECKOUT_TARGET)) helm/build: $(if $(wildcard $(PROJECT_ROOT)/helm/patches),$(HELM_GIT_PATCH_TARGET),) # Metallb requires 2 charts. Consider this a temporary work-around. $(BUILD_LIB)/helm_copy.sh $(HELM_SOURCE_REPOSITORY) metallb/crds charts/crds $(OUTPUT_DIR) - $(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) metallb/crds $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) $(HELM_IMAGE_LIST) + $(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) metallb/crds $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) "$(PROJECT_DEPENDENCIES)" "$(FORCE_JSON_SCHEMA_FILE)" $(HELM_IMAGE_LIST) $(BUILD_LIB)/helm_replace.sh metallb/crds $(OUTPUT_DIR) $(BUILD_LIB)/helm_build.sh $(OUTPUT_DIR) metallb/crds $(BUILD_LIB)/helm_copy.sh $(HELM_SOURCE_REPOSITORY) $(HELM_DESTINATION_REPOSITORY) $(HELM_DIRECTORY) $(OUTPUT_DIR) - PACKAGE_DEPENDENCIES=metallb-crds $(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) $(HELM_IMAGE_LIST) + $(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) metallb-crds "$(FORCE_JSON_SCHEMA_FILE)" $(HELM_IMAGE_LIST) $(BUILD_LIB)/helm_replace.sh $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR) $(BUILD_LIB)/helm_build.sh $(OUTPUT_DIR) $(HELM_DESTINATION_REPOSITORY)