Skip to content

Commit

Permalink
Merge pull request #983 from bdunne/master_quinteros_followup
Browse files Browse the repository at this point in the history
quinteros branching followup
  • Loading branch information
agrare authored Aug 16, 2023
2 parents 651d80b + b7688a5 commit dcfcf38
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion images/manageiq-base-worker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion images/manageiq-hotfix/Dockerfile
Original file line number Diff line number Diff line change
@@ -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}

Expand Down
2 changes: 1 addition & 1 deletion images/manageiq-orchestrator/Dockerfile
Original file line number Diff line number Diff line change
@@ -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}
Expand Down
2 changes: 1 addition & 1 deletion images/manageiq-ui-worker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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}
Expand Down
2 changes: 1 addition & 1 deletion images/manageiq-webserver-worker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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}
Expand Down
18 changes: 15 additions & 3 deletions lib/tasks/release.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand All @@ -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}'")

Expand Down

0 comments on commit dcfcf38

Please sign in to comment.