Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quinteros branching followup #983

Merged
merged 2 commits into from
Aug 16, 2023
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
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
Loading