|
1 | | -help 'Run release checklist' |
| 1 | +help 'Run release checklist' |
2 | 2 | usage 'release VERSION' |
3 | 3 | action :release do |args| |
4 | 4 | version = args['VERSION'] |
5 | 5 |
|
6 | 6 | checklist = Checklist.new |
7 | 7 |
|
8 | | - |
9 | 8 | say "Checklist for version !txtgrn!#{version}!txtrst!" |
10 | 9 |
|
11 | | - checklist.run "git on master and clean" do |
12 | | - `git status`.match /On branch master.*nothing to commit/m |
| 10 | + checklist.run 'git on master and clean' do |
| 11 | + `git status`.match(/On branch master.*nothing to commit/m) |
13 | 12 | end |
14 | 13 |
|
15 | | - checklist.run "code version" do |
| 14 | + checklist.run 'code version' do |
16 | 15 | File.read('lib/bashly/version.rb').include? version |
17 | 16 | end |
18 | 17 |
|
19 | | - checklist.run "dockerfile version" do |
| 18 | + checklist.run 'dockerfile version' do |
20 | 19 | File.read('Dockerfile').include? version |
21 | 20 | end |
22 | 21 |
|
23 | | - checklist.run "local git tag" do |
| 22 | + checklist.run 'local git tag' do |
24 | 23 | !`git tag -l v#{version}`.empty? |
25 | 24 | end |
26 | 25 |
|
27 | | - checklist.run "changelog" do |
| 26 | + checklist.run 'changelog' do |
28 | 27 | File.read('CHANGELOG.md').include? "v#{version}" |
29 | 28 | end |
30 | 29 |
|
31 | | - checklist.run "github tag" do |
| 30 | + checklist.run 'github tag' do |
32 | 31 | checklist.url_exist? "https://github.com/DannyBen/bashly/tree/v#{version}" |
33 | 32 | end |
34 | 33 |
|
35 | | - checklist.run "local gem is built" do |
| 34 | + checklist.run 'local gem is built' do |
36 | 35 | File.exist? "gems/bashly-#{version}.gem" |
37 | 36 | end |
38 | 37 |
|
39 | | - checklist.run "published gem version" do |
| 38 | + checklist.run 'published gem version' do |
40 | 39 | checklist.url_exist? "https://rubygems.org/gems/bashly/versions/#{version}" |
41 | 40 | end |
42 | 41 |
|
43 | | - checklist.run "local docker image version" do |
44 | | - `docker images`.match /bashly\s*#{version}/ |
| 42 | + checklist.run 'local docker image version' do |
| 43 | + `docker images`.match(/bashly\s*#{version}/) |
45 | 44 | end |
46 | 45 |
|
47 | | - checklist.run "remote docker image version" do |
48 | | - digest = `docker inspect --format='{{.RepoDigests}}' dannyben/bashly:#{version}`[/@sha256:(.*)\]/,1] |
| 46 | + checklist.run 'remote docker image version' do |
| 47 | + digest = `docker inspect --format='{{.RepoDigests}}' dannyben/bashly:#{version}`[/@sha256:(.*)\]/, 1] |
49 | 48 | if digest |
50 | 49 | checklist.url_exist? "https://hub.docker.com/layers/dannyben/bashly/#{version}/images/sha256-#{digest}" |
51 | 50 | else |
52 | 51 | false |
53 | 52 | end |
54 | 53 | end |
55 | 54 |
|
56 | | - checklist.run "github release" do |
| 55 | + checklist.run 'github release' do |
57 | 56 | `curl -SsI https://github.com/DannyBen/bashly/releases/latest`.match "location: https://github.com/.*/v#{version}" |
58 | 57 | end |
59 | 58 |
|
60 | | - checklist.run "local retype is on master and clean" do |
61 | | - `git -C /vagrant/sites/bashly status`.match /On branch master.*nothing to commit/m |
| 59 | + checklist.run 'local retype is on master and clean' do |
| 60 | + `git -C /vagrant/sites/bashly status`.match(/On branch master.*nothing to commit/m) |
62 | 61 | end |
63 | 62 |
|
64 | | - checklist.run "local retype version" do |
| 63 | + checklist.run 'local retype version' do |
65 | 64 | YAML.load_file('/vagrant/sites/bashly/retype.yml')['branding']['label'] == "v#{version}" |
66 | 65 | end |
67 | 66 |
|
68 | | - checklist.run "remote retype version" do |
| 67 | + checklist.run 'remote retype version' do |
69 | 68 | `curl -Ss https://raw.githubusercontent.com/DannyBen/bashly-book/master/retype.yml`.include? "label: v#{version}" |
70 | 69 | end |
71 | 70 |
|
72 | | - color = checklist.failed == 0 ? '!bldgrn!' : '!bldred!' |
| 71 | + color = checklist.failed.zero? ? '!bldgrn!' : '!bldred!' |
73 | 72 | say " #{color}Done with #{checklist.failed} failed tasks" |
74 | 73 | end |
0 commit comments