Skip to content

Commit

Permalink
Add Candlepin branch procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Jul 31, 2024
1 parent e183fff commit 8d90b5d
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
20 changes: 17 additions & 3 deletions procedure
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions procedures/candlepin/branch.md.erb
Original file line number Diff line number Diff line change
@@ -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`
10 changes: 10 additions & 0 deletions procedures/candlepin/release.md.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Build Package

- [ ] Acquire Candlepin SRPM for <%= release %>
- [ ] Build into Copr
- `copr build @theforeman/candlepin-staging-<%= release %> <SRPM>`
- [ ] 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/)

0 comments on commit 8d90b5d

Please sign in to comment.