From 37e740dbdf6ac1eb8c30c4c4f40928aec9beb2fc Mon Sep 17 00:00:00 2001 From: Brandon Dunne Date: Tue, 15 Aug 2023 16:22:39 -0400 Subject: [PATCH 1/2] Fully qualify image names --- images/manageiq-base-worker/Dockerfile | 2 +- images/manageiq-hotfix/Dockerfile | 4 +++- images/manageiq-orchestrator/Dockerfile | 2 +- images/manageiq-ui-worker/Dockerfile | 2 +- images/manageiq-webserver-worker/Dockerfile | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/images/manageiq-base-worker/Dockerfile b/images/manageiq-base-worker/Dockerfile index e54188d18..4ddb59020 100644 --- a/images/manageiq-base-worker/Dockerfile +++ b/images/manageiq-base-worker/Dockerfile @@ -1,4 +1,4 @@ -ARG FROM_REPO=manageiq +ARG FROM_REPO=docker.io/manageiq ARG FROM_TAG=latest FROM ${FROM_REPO}/manageiq-base:${FROM_TAG} AS vddk diff --git a/images/manageiq-hotfix/Dockerfile b/images/manageiq-hotfix/Dockerfile index da776bb04..a765be1b0 100644 --- a/images/manageiq-hotfix/Dockerfile +++ b/images/manageiq-hotfix/Dockerfile @@ -1,4 +1,6 @@ -ARG FROM_IMAGE=docker.io/manageiq/manageiq-base:latest +ARG FROM_REPO=docker.io/manageiq +ARG FROM_TAG=latest +ARG FROM_IMAGE=${FROM_REPO}/manageiq-base:${FROM_TAG} FROM ${FROM_IMAGE} diff --git a/images/manageiq-orchestrator/Dockerfile b/images/manageiq-orchestrator/Dockerfile index 29ed0cdc3..c280887e0 100644 --- a/images/manageiq-orchestrator/Dockerfile +++ b/images/manageiq-orchestrator/Dockerfile @@ -1,4 +1,4 @@ -ARG FROM_REPO=manageiq +ARG FROM_REPO=docker.io/manageiq ARG FROM_TAG=latest FROM ${FROM_REPO}/manageiq-base:${FROM_TAG} diff --git a/images/manageiq-ui-worker/Dockerfile b/images/manageiq-ui-worker/Dockerfile index 4d61a89df..ffef94f68 100644 --- a/images/manageiq-ui-worker/Dockerfile +++ b/images/manageiq-ui-worker/Dockerfile @@ -1,4 +1,4 @@ -ARG FROM_REPO=manageiq +ARG FROM_REPO=docker.io/manageiq ARG FROM_TAG=latest FROM ${FROM_REPO}/manageiq-webserver-worker:${FROM_TAG} diff --git a/images/manageiq-webserver-worker/Dockerfile b/images/manageiq-webserver-worker/Dockerfile index 3986c3d64..19fcf03c3 100644 --- a/images/manageiq-webserver-worker/Dockerfile +++ b/images/manageiq-webserver-worker/Dockerfile @@ -1,4 +1,4 @@ -ARG FROM_REPO=manageiq +ARG FROM_REPO=docker.io/manageiq ARG FROM_TAG=latest FROM ${FROM_REPO}/manageiq-base-worker:${FROM_TAG} From b7688a594f004ec44785fdf5934e07a835f8686e Mon Sep 17 00:00:00 2001 From: Brandon Dunne Date: Tue, 15 Aug 2023 16:23:09 -0400 Subject: [PATCH 2/2] Update release.rake for things missed in quinteros branch --- lib/tasks/release.rake | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/tasks/release.rake b/lib/tasks/release.rake index 69a488f4e..94cf04e3d 100644 --- a/lib/tasks/release.rake +++ b/lib/tasks/release.rake @@ -48,7 +48,7 @@ namespace :release do # Modify deploy CRD deploy_crd = root.join("manageiq-operator", "config", "crd", "bases", "manageiq.org_manageiqs.yaml") content = deploy_crd.read - deploy_crd.write(content.sub(/(tag used for the orchestrator and worker deployments\n\s+\(default: )[^\)]+(\))/, "\\1latest-#{branch}\\2")) + deploy_crd.write(content.sub(/(worker deployments\s+\(default: )latest[^\)]*(\))/, "\\1latest-#{branch}\\2")) # Modify bin/build build_script = root.join("bin", "build") @@ -57,6 +57,13 @@ namespace :release do content.sub!(/(BUILD_REF:-)\w+(\})/, "\\1#{branch}\\2") build_script.write(content) + # Modify bin/build_hotfix + hotfix_script = root.join("bin", "build_hotfix") + content = hotfix_script.read + content.sub!(/^(TAG=).+$/, "\\1latest-#{branch}") + content.sub!(/(BUILD_REF:-)\w+(\})/, "\\1#{branch}\\2") + hotfix_script.write(content) + # Modify bin/remove_images remove_script = root.join("bin", "remove_images") content = remove_script.read @@ -72,15 +79,20 @@ namespace :release do base_dockerfile.write(content) # Modify Dockerfiles - dockerfiles = %w[manageiq-base-worker manageiq-webserver-worker manageiq-ui-worker manageiq-orchestrator].map do |worker| + dockerfiles = %w[manageiq-base-worker manageiq-webserver-worker manageiq-ui-worker manageiq-orchestrator manageiq-hotfix].map do |worker| root.join("images", worker, "Dockerfile").tap do |dockerfile| content = dockerfile.read dockerfile.write(content.sub(/^(ARG FROM_TAG=).+$/, "\\1latest-#{branch}")) end end + # Modify Workflows + build_workflow = root.join(".github", "workflows", "build_pods.yaml") + content = build_workflow.read + build_workflow.write(content.sub(/^(\s+run: bin\/build.*)latest(.+)$/, "\\1latest-#{branch}\\2")) + # Commit - files_to_update = [readme, operator_readme, cr, types, deploy_operator, deploy_crd, build_script, remove_script, base_dockerfile, *dockerfiles] + files_to_update = [readme, operator_readme, cr, types, deploy_operator, deploy_crd, build_script, hotfix_script, remove_script, build_workflow, base_dockerfile, *dockerfiles] exit $?.exitstatus unless system("git add #{files_to_update.join(" ")}") exit $?.exitstatus unless system("git commit -m 'Changes for new branch #{branch}'")