diff --git a/procedure b/procedure index c86881f..c0c4610 100755 --- a/procedure +++ b/procedure @@ -20,6 +20,7 @@ def header(filename) This procedure was generated from [#{git_filename} at #{git_commit}](https://github.com/theforeman/theforeman-rel-eng/blob/#{git_commit}/#{git_filename}) [ ] Make this post a wiki ([help](https://meta.discourse.org/t/create-a-wiki-post/30802)) + HEADER end @@ -59,9 +60,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 +130,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 diff --git a/procedures/candlepin/branch.md.erb b/procedures/candlepin/branch.md.erb new file mode 100644 index 0000000..6ce8f5b --- /dev/null +++ b/procedures/candlepin/branch.md.erb @@ -0,0 +1,21 @@ +# Branch Packaging + +- [ ] Clone https://github.com/theforeman/candlepin-packaging +- [ ] Check out most recent branch `rpm/< latest_version >` +- [ ] Create a new branch for the version being added + - `git checkout -b rpm/<%= release %>` +- [ ] Update `package_manifest.yaml` with <%= release %> +- [ ] Create project in copr `obal copr-project candlepin-staging-<%= release %>` +- [ ] Push new branch to https://github.com/theforeman/candlepin-packaging + +# Update CI + +- [ ] Open a PR with the following updates: + - [ ] Add new vars file for the version being branched, [for example](https://github.com/theforeman/jenkins-jobs/blob/master/theforeman.org/pipelines/vars/candlepin/4.4.groovy) + - [ ] Add <%= release %> to https://github.com/theforeman/jenkins-jobs/blob/master/theforeman.org/yaml/includes/candlepin_versions.yaml.inc + - [ ] Add <%= release %> to https://github.com/theforeman/jenkins-jobs/blob/master/centos.org/jobs/candlepin-pipelines.yml +- Create new GPG key for release + - [ ] <%= rel_eng_script('generate_gpg') %>: `VERSION=<%= release %> PROJECT=candlepin ./generate_gpg` + - [ ] <%= rel_eng_script('export_gpg_private') %>: `VERSION=<%= release %> PROJECT=candlepin ./export_gpg_private` + - [ ] <%= rel_eng_script('sign_gpg') %>: `VERSION=<%= release %> PROJECT=candlepin ./sign_gpg` + - [ ] <%= rel_eng_script('upload_gpg') %>: `VERSION=<%= release %> PROJECT=candlepin ./upload_gpg` diff --git a/procedures/candlepin/release.md.erb b/procedures/candlepin/release.md.erb new file mode 100644 index 0000000..a4afc67 --- /dev/null +++ b/procedures/candlepin/release.md.erb @@ -0,0 +1,10 @@ +# Build Package + +- [ ] Acquire Candlepin SRPM for <%= release %> +- [ ] Build into Copr + - `copr build @theforeman/candlepin-staging-<%= release %> ` +- [ ] Sign RPMs + - [ ] 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/)