-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add Candlepin branch procedure #375
Conversation
7d35b99
to
f3137cb
Compare
f3137cb
to
62122b8
Compare
62122b8
to
c2e8129
Compare
procedures/candlepin/release.md.erb
Outdated
- [ ] VERSION=<%= release %> PROJECT=candlepin <%= rel_eng_script('generate_stage_repository') %> | ||
- [ ] VERSION=<%= release %> PROJECT=candlepin <%= rel_eng_script('sign_stage_rpms') %> | ||
- [ ] VERSION=<%= release %> PROJECT=candlepin <%= rel_eng_script('upload_stage_rpms') %> | ||
- [ ] [Run release pipeline](https://ci.theforeman.org/job/candlepin-<%= release %>-rpm-pipeline/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be
- [ ] [Run release pipeline](https://ci.theforeman.org/job/candlepin-<%= release %>-rpm-pipeline/) | |
- [ ] Kick off the [release pipeline](https://ci.theforeman.org/job/candlepin-<%= release %>-rpm-pipeline/) by calling <%= rel_eng_script('release_pipeline') %> |
(requires a tiny adjustment in ci-jobs
script to know how to call candlepin
pipes)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to modify the procedure script:
$ ./procedure branch --project candlepin
./procedure:136:in `<main>': invalid argument: --project candlepin (OptionParser::InvalidArgument)
I ended up writing this patch
diff --git a/procedure b/procedure
index c86881f42ca5..c5c7eaa8b88e 100755
--- a/procedure
+++ b/procedure
@@ -59,9 +59,9 @@ global = OptionParser.new do |opts|
end
procedures = {
'branch' => OptionParser.new do |opts|
- opts.banner = "Usage: #{opts.program_name} branch --project [foreman|katello] --release [X.Y] --target-date [YYYY-MM-DD] --owner [OWNER] [--engineer [ENGINEER]]"
+ opts.banner = "Usage: #{opts.program_name} branch --project [foreman|katello|candlepin] --release [X.Y] --target-date [YYYY-MM-DD] --owner [OWNER] [--engineer [ENGINEER]]"
- opts.on('--project [PROJECT]', ['foreman', 'katello'],
+ opts.on('--project [PROJECT]', ['foreman', 'katello', 'candlepin'],
'Project to generate branch procedure for') do |t|
context[:project] = t
end
@@ -129,13 +129,26 @@ procedures = {
end
}
+def missing_required_option?(procedure, context)
+ case context[:project]
+ when 'candlepin'
+ context[:release].nil?
+ when 'katello'
+ context[:target_date].nil? || context[:owner].nil? || (procedure == 'release' && context[:foreman_version].nil?)
+ when 'foreman'
+ context[:target_date].nil? || context[:owner].nil?
+ else
+ true
+ end
+end
+
global.order!
procedure = ARGV.shift
if procedures.key?(procedure)
command = procedures[procedure]
command.order!
- unless context[:project] && context[:target_date] && context[:owner] && (context[:project] != 'katello' || procedure != 'release' || context[:foreman_version])
+ if missing_required_option?(procedure, context)
STDERR.puts command.help
exit 1
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please include my suggested changes to the procedure
script.
bd2dde9
to
8d90b5d
Compare
Updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up creating ehelms#1 with my comments. If you merge theforeman/jenkins-jobs#484 and that PR I think my concerns are addressed.
This reuses the existing branch_project and branch_push scripts to handle candlepin-packaging's branching. branch_project is modified to update package_manifest.yaml as well as some setting files. For CI it uses the branch-candlepin script inside the repository while also using the release_pipeline script to kick off Jenkins.
No description provided.