Skip to content

SET-1115 Automate Jenkins update process #257

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RanabirChakraborty
Copy link
Contributor

ansible.builtin.replace:
path: "{{ hephaestus_dir }}/Dockerfile"
regexp: '^FROM jenkins/jenkins:.*$'
replace: "FROM jenkins/jenkins:{{ jenkins_version }}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤣

@RanabirChakraborty just do a PR against Ares to change that!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we change ares to FROM jenkins/jenkins:{{ jenkins_version }} once the jenkins version update it done, it'll be like that only locally in olympus Next time, it'll be difficult to change the version for that we have to fetch/update ares or make it like before again.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RanabirChakraborty No, you misunderstand me.
I meant change the Dockerfile is Ares to make the version a parameter:

ARG jenkins_version
FROM jenkins/jenkins:$jenkins_version

Then we don't need to modify the file in ares (which will prevent having to constantly add a commit to Ares everytime we update jenkins.

@@ -0,0 +1,72 @@
---
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should NOT live in its folder, in the root folder, but inside the playbooks/ folder.

- vars.yml

tasks:
- name: "Replace Jenkins version in Dockerfile"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a callt o assert: to double check the required parameter (mostly the jenkins_version) are indeed defined.
(and I would remove the default value for this variable)

name: hephaestus.next
tag: latest
path: "{{ hephaestus_dir }}"
register: image_build
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to pass the value of jenkins_version as argument to the (underlying) podman command. As this stands, it will build the image based on the default value for jenkins_version (in the Dockerfile, if any) rather than the one specified in jenkins_version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants