Release of hammer-cli gem

Requirements

  • push access to https://github.com/theforeman/hammer-cli
  • push access to rubygems.org for hammer-cli
  • sudo yum install transifex-client python-slugify asciidoc
  • ensure neither the git push or gem push don't require interractive auth. If you can't use api key or ssh key to auth skip these steps and run them form the shell manually
  • to push translations you need an account on Transifex

Release process

  • Follow the steps with <Shift>+<Enter> or <Ctrl>+<Enter>,<Down>
  • If anything fails, fix it and re-run the step if applicable

Release settings


In [1]:
%cd ..


/home/mshira/git/hammer-cli

Update the following notebook settings


In [2]:
NEW_VERSION = '2.0.0'
LAST_VERSION = '0.19.0'
DEVELOP_VERSION = '2.1.0-develop'
NEXT_FUTURE_VERSION = '2.1.0'
MAJOR_RELEASE = True
STABLE_BRANCH = '2.0-stable'
GIT_REMOTE_UPSTREAM = 'origin'
WORK_BRANCH = 'master' if MAJOR_RELEASE else STABLE_BRANCH

Ensure the repo is up to date


In [3]:
! git checkout {WORK_BRANCH}


M	rel-eng/gem_release.ipynb
Already on 'master'

In [4]:
! git fetch {GIT_REMOTE_UPSTREAM}


remote: Enumerating objects: 14, done.
remote: Counting objects: 100% (14/14), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 14 (delta 4), reused 8 (delta 4), pack-reused 0
Unpacking objects: 100% (14/14), done.
From github.com:theforeman/hammer-cli
   bc12a4d..d62870f  0.19-stable -> origin/0.19-stable
 * [new tag]         0.19.2      -> 0.19.2

In [6]:
! git rebase {GIT_REMOTE_UPSTREAM}/{WORK_BRANCH}


error: cannot rebase: You have unstaged changes.
error: Please commit or stash them.

Run tests localy


In [5]:
! bundle update


Fetching gem metadata from https://rubygems.org/........
Resolving dependencies...
Using rake 10.1.1
Using json 2.3.0
Using oauth 0.5.4
Using http-accept 1.7.0
Using unf_ext 0.0.7.6
Using unf 0.1.4
Using domain_name 0.5.20190701
Using http-cookie 1.0.3
Using mime-types-data 3.2019.1009
Using mime-types 3.3.1
Using netrc 0.11.0
Using rest-client 2.1.0
Using apipie-bindings 0.3.0
Using awesome_print 1.8.0
Using debug_inspector 0.0.3
Using binding_of_caller 0.8.0
Using builder 3.2.4
Using bundler 1.17.3
Using byebug 11.1.1 (was 11.0.1)
Using ci_reporter 1.9.3
Using clamp 1.1.2
Using coderay 1.1.2
Using docile 1.3.2
Using fast_gettext 2.0.2 (was 2.0.1)
Fetching locale 2.1.3 (was 2.1.2)
Installing locale 2.1.3 (was 2.1.2)
Using text 1.3.1
Fetching gettext 3.3.4 (was 3.2.9)
Installing gettext 3.3.4 (was 3.2.9)
Using highline 2.0.3
Using little-plugger 1.1.4
Using multi_json 1.14.1
Using logging 2.2.2
Using unicode 0.4.4.4
Using unicode-display_width 1.6.1 (was 1.6.0)
Using hammer_cli 2.0.0.pre.develop (was 0.19.1) from source at `.`
Using interception 0.5
Using method_source 0.9.2
Using minitest 4.7.4
Using minitest-spec-context 0.0.4
Using mocha 1.11.2 (was 1.11.1)
Using pry 0.12.2
Using pry-byebug 3.8.0 (was 3.7.0)
Using yard 0.9.24 (was 0.9.20)
Using pry-doc 1.0.0
Using pry-rails 0.3.9
Using pry-rescue 1.5.0
Using pry-stack_explorer 0.4.9.3
Using simplecov-html 0.11.0 (was 0.10.2)
Using simplecov 0.18.1 (was 0.17.1)
Using thor 1.0.1
Bundle updated!

In [7]:
! bundle exec rake test


/home/mshira/.rvm/rubies/ruby-2.5.1/bin/ruby -I"lib:lib" -I"/home/mshira/.rvm/gems/ruby-2.5.1/gems/rake-10.1.1/lib" "/home/mshira/.rvm/gems/ruby-2.5.1/gems/rake-10.1.1/lib/rake/rake_test_loader.rb" "test/unit/messages_test.rb" "test/unit/exception_handler_test.rb" "test/unit/modules_test.rb" "test/unit/connection_test.rb" "test/unit/completer_test.rb" "test/unit/csv_parser_test.rb" "test/unit/option_builder_test.rb" "test/unit/utils_test.rb" "test/unit/apipie/command_test.rb" "test/unit/apipie/option_builder_test.rb" "test/unit/apipie/api_connection_test.rb" "test/unit/apipie/option_definition_test.rb" "test/unit/command_extensions_test.rb" "test/unit/main_test.rb" "test/unit/options/processor_list_test.rb" "test/unit/options/validators/dsl_test.rb" "test/unit/options/sources/command_line_test.rb" "test/unit/options/sources/saved_defaults_test.rb" "test/unit/options/matcher_test.rb" "test/unit/options/option_collector_test.rb" "test/unit/options/normalizers_test.rb" "test/unit/options/option_definition_test.rb" "test/unit/settings_test.rb" "test/unit/history_test.rb" "test/unit/defaults_test.rb" "test/unit/logger_test.rb" "test/unit/output/formatters_test.rb" "test/unit/output/record_collection_test.rb" "test/unit/output/dsl_test.rb" "test/unit/output/definition_test.rb" "test/unit/output/output_test.rb" "test/unit/output/field_filter_test.rb" "test/unit/output/fields_test.rb" "test/unit/output/adapter/table_test.rb" "test/unit/output/adapter/json_test.rb" "test/unit/output/adapter/abstract_test.rb" "test/unit/output/adapter/yaml_test.rb" "test/unit/output/adapter/csv_test.rb" "test/unit/output/adapter/base_test.rb" "test/unit/abstract_test.rb" "test/unit/i18n_test.rb" "test/unit/bash_test.rb" "test/unit/help/definition/section_test.rb" "test/unit/help/definition/list_test.rb" "test/unit/help/definition/text_test.rb" "test/unit/help/definition/abstract_item_test.rb" "test/unit/help/definition/note_test.rb" "test/unit/help/definition_test.rb" "test/unit/help/builder_test.rb" "test/unit/help/text_builder_test.rb" "test/unit/ca_cert_manager_test.rb" "test/functional/help_test.rb" "test/functional/nil_values_test.rb" "test/functional/defaults_test.rb" 
Mocha deprecation warning at /home/mshira/git/hammer-cli/test/test_helper.rb:14:in `require': Require 'mocha/test_unit', 'mocha/minitest' or 'mocha/api' instead of 'mocha/setup'.
Run options: --seed 52387

# Running tests:

..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Finished tests in 0.409490s, 2075.7550 tests/s, 3130.7270 assertions/s.

850 tests, 1282 assertions, 0 failures, 0 errors, 0 skips
Coverage report generated for MiniTest to /home/mshira/git/coverage. 3092 / 3469 LOC (89.13%) covered.

In [8]:
! sed -i 's/Gem::Version.new .*/Gem::Version.new "{NEW_VERSION}"/' lib/hammer_cli/version.rb

In [9]:
# Parse git changelog
from IPython.display import Markdown as md
from subprocess import check_output
from shlex import split
import re

def format_log_entry(entry):
    issues = re.findall(r'[^(]#([0-9]+)', entry)
    entry = re.sub(r'([fF]ixes|[rR]efs)[^-]*-\s*(.*)', r'\2', entry)
    entry = '* ' + entry.capitalize()
    entry = re.sub(r'\(#([0-9]+)\)', r'([PR #\1](https://github.com/theforeman/hammer-cli/pull/\1))', entry)
    for i in issues:
        referenced_issues.append(i)
        entry = entry + ', [#%s](http://projects.theforeman.org/issues/%s)' % (i, i)
    return entry

def skip(entry):
    if re.match(r'Merge pull', entry) or \
      re.match(r'^i18n', entry) or \
      re.match(r'^Bump to version', entry):
        return True
    else:
        return False
referenced_issues = []    
git_log_cmd = 'git log --pretty=format:"%%s" %s..HEAD' % LAST_VERSION
log = check_output(split(git_log_cmd)).decode('utf8').split('\n')
change_log = [format_log_entry(e) for e in log if not skip(e)]
md('\n'.join(change_log))


Out[9]:
  • Bump version to 2.0.0
  • Bump version to 2.0 (PR #324)
  • Better promts for missing arguments, #28793
  • Allow column max width more than 80, #28503
  • Remove computing sha, #27728
  • Fixed userdata false display in image list, #28134
  • Add new bash completion, #27728
  • Allow adapters print page by page, #17819
  • Add release documentation (PR #317), #28149
  • Fix pr links in release notes (PR #318), #28202
  • Extract table generator into reusable component (PR #314), #27318
  • Better prompts for missing arguments (PR #313), #27595
  • Bump to 0.20-develop

In [10]:
# Write release notes
from datetime import datetime
import fileinput
import sys

fh = fileinput.input('doc/release_notes.md', inplace=True)  
for line in fh:  
    print(line.rstrip())
    if re.match(r'========', line):
        print('### %s (%s)' % (NEW_VERSION, datetime.today().strftime('%Y-%m-%d')))
        for entry in change_log:
            print(entry)
        print('')
fh.close()

Manual step: Update deps in the gemspec if neccessary

Check what is going to be commited


In [11]:
! git add -u
! git status


On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   doc/release_notes.md
	modified:   lib/hammer_cli/version.rb
	modified:   rel-eng/gem_release.ipynb


In [12]:
! git diff --cached


diff --git a/doc/release_notes.md b/doc/release_notes.md
index c643cf1..0ae7c05 100644
--- a/doc/release_notes.md
+++ b/doc/release_notes.md
@@ -1,5 +1,20 @@
 Release notes
 =============
+### 2.0.0 (2020-02-12)
+* Bump version to 2.0.0
+* Bump version to 2.0 ([PR #324](https://github.com/theforeman/hammer-cli/pull/324))
+* Better promts for missing arguments, [#28793](http://projects.theforeman.org/issues/28793)
+* Allow column max width more than 80, [#28503](http://projects.theforeman.org/issues/28503)
+* Remove computing sha, [#27728](http://projects.theforeman.org/issues/27728)
+* Fixed userdata false display in image list, [#28134](http://projects.theforeman.org/issues/28134)
+* Add new bash completion, [#27728](http://projects.theforeman.org/issues/27728)
+* Allow adapters print page by page, [#17819](http://projects.theforeman.org/issues/17819)
+* Add release documentation ([PR #317](https://github.com/theforeman/hammer-cli/pull/317)), [#28149](http://projects.theforeman.org/issues/28149)
+* Fix pr links in release notes ([PR #318](https://github.com/theforeman/hammer-cli/pull/318)), [#28202](http://projects.theforeman.org/issues/28202)
+* Extract table generator into reusable component ([PR #314](https://github.com/theforeman/hammer-cli/pull/314)), [#27318](http://projects.theforeman.org/issues/27318)
+* Better prompts for missing arguments ([PR #313](https://github.com/theforeman/hammer-cli/pull/313)), [#27595](http://projects.theforeman.org/issues/27595)
+* Bump to 0.20-develop
+
 ### 0.19.0 (2019-10-26)
 * Allow schema building for custom options ([PR #316](https://github.com/theforeman/hammer-cli/pull/316)), [#27899](http://projects.theforeman.org/issues/27899)
 * New lines in text attr dont break output ([PR #300](https://github.com/theforeman/hammer-cli/pull/300)), [#25878](http://projects.theforeman.org/issues/25878)
diff --git a/lib/hammer_cli/version.rb b/lib/hammer_cli/version.rb
index e168e40..47c6e96 100644
--- a/lib/hammer_cli/version.rb
+++ b/lib/hammer_cli/version.rb
@@ -1,5 +1,5 @@
 module HammerCLI
   def self.version
-    @version ||= Gem::Version.new "2.0.0-develop"
+    @version ||= Gem::Version.new "2.0.0"
   end
 end
diff --git a/rel-eng/gem_release.ipynb b/rel-eng/gem_release.ipynb
index b5e504b..1704889 100644
--- a/rel-eng/gem_release.ipynb
+++ b/rel-eng/gem_release.ipynb
@@ -22,9 +22,17 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
+   "execution_count": 1,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "/home/mshira/git/hammer-cli\n"
+     ]
+    }
+   ],
    "source": [
     "%cd .."
    ]
@@ -38,17 +46,17 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 2,
    "metadata": {},
    "outputs": [],
    "source": [
-    "NEW_VERSION = '0.19.0'\n",
-    "LAST_VERSION = '0.18.0'\n",
-    "DEVELOP_VERSION = '0.20-develop'\n",
-    "NEXT_FUTURE_VERSION = '0.20.0'\n",
+    "NEW_VERSION = '2.0.0'\n",
+    "LAST_VERSION = '0.19.0'\n",
+    "DEVELOP_VERSION = '2.1.0-develop'\n",
+    "NEXT_FUTURE_VERSION = '2.1.0'\n",
     "MAJOR_RELEASE = True\n",
-    "STABLE_BRANCH = '0.19-stable'\n",
-    "GIT_REMOTE_UPSTREAM = 'upstream'\n",
+    "STABLE_BRANCH = '2.0-stable'\n",
+    "GIT_REMOTE_UPSTREAM = 'origin'\n",
     "WORK_BRANCH = 'master' if MAJOR_RELEASE else STABLE_BRANCH"
    ]
   },
@@ -61,27 +69,60 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
+   "execution_count": 3,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "M\trel-eng/gem_release.ipynb\r\n",
+      "Already on 'master'\r\n"
+     ]
+    }
+   ],
    "source": [
     "! git checkout {WORK_BRANCH}"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
+   "execution_count": 4,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "remote: Enumerating objects: 14, done.\u001b[K\n",
+      "remote: Counting objects: 100% (14/14), done.\u001b[K\n",
+      "remote: Compressing objects: 100% (10/10), done.\u001b[K\n",
+      "remote: Total 14 (delta 4), reused 8 (delta 4), pack-reused 0\u001b[K\n",
+      "Unpacking objects: 100% (14/14), done.\n",
+      "From github.com:theforeman/hammer-cli\n",
+      "   bc12a4d..d62870f  0.19-stable -> origin/0.19-stable\n",
+      " * [new tag]         0.19.2      -> 0.19.2\n"
+     ]
+    }
+   ],
    "source": [
     "! git fetch {GIT_REMOTE_UPSTREAM}"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
+   "execution_count": 6,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "error: cannot rebase: You have unstaged changes.\r\n",
+      "error: Please commit or stash them.\r\n"
+     ]
+    }
+   ],
    "source": [
     "! git rebase {GIT_REMOTE_UPSTREAM}/{WORK_BRANCH}"
    ]
@@ -95,18 +136,98 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
+   "execution_count": 5,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Fetching gem metadata from https://rubygems.org/........\n",
+      "Resolving dependencies...\n",
+      "Using rake 10.1.1\n",
+      "Using json 2.3.0\n",
+      "Using oauth 0.5.4\n",
+      "Using http-accept 1.7.0\n",
+      "Using unf_ext 0.0.7.6\n",
+      "Using unf 0.1.4\n",
+      "Using domain_name 0.5.20190701\n",
+      "Using http-cookie 1.0.3\n",
+      "Using mime-types-data 3.2019.1009\n",
+      "Using mime-types 3.3.1\n",
+      "Using netrc 0.11.0\n",
+      "Using rest-client 2.1.0\n",
+      "Using apipie-bindings 0.3.0\n",
+      "Using awesome_print 1.8.0\n",
+      "Using debug_inspector 0.0.3\n",
+      "Using binding_of_caller 0.8.0\n",
+      "Using builder 3.2.4\n",
+      "Using bundler 1.17.3\n",
+      "Using byebug 11.1.1\u001b[32m (was 11.0.1)\u001b[0m\n",
+      "Using ci_reporter 1.9.3\n",
+      "Using clamp 1.1.2\n",
+      "Using coderay 1.1.2\n",
+      "Using docile 1.3.2\n",
+      "Using fast_gettext 2.0.2\u001b[32m (was 2.0.1)\u001b[0m\n",
+      "\u001b[32mFetching locale 2.1.3\u001b[32m (was 2.1.2)\u001b[0m\u001b[0m\n",
+      "\u001b[32mInstalling locale 2.1.3\u001b[32m (was 2.1.2)\u001b[0m\u001b[0m\n",
+      "Using text 1.3.1\n",
+      "\u001b[32mFetching gettext 3.3.4\u001b[32m (was 3.2.9)\u001b[0m\u001b[0m\n",
+      "\u001b[32mInstalling gettext 3.3.4\u001b[32m (was 3.2.9)\u001b[0m\u001b[0m\n",
+      "Using highline 2.0.3\n",
+      "Using little-plugger 1.1.4\n",
+      "Using multi_json 1.14.1\n",
+      "Using logging 2.2.2\n",
+      "Using unicode 0.4.4.4\n",
+      "Using unicode-display_width 1.6.1\u001b[32m (was 1.6.0)\u001b[0m\n",
+      "Using hammer_cli 2.0.0.pre.develop\u001b[32m (was 0.19.1)\u001b[0m from source at `.`\n",
+      "Using interception 0.5\n",
+      "Using method_source 0.9.2\n",
+      "Using minitest 4.7.4\n",
+      "Using minitest-spec-context 0.0.4\n",
+      "Using mocha 1.11.2\u001b[32m (was 1.11.1)\u001b[0m\n",
+      "Using pry 0.12.2\n",
+      "Using pry-byebug 3.8.0\u001b[32m (was 3.7.0)\u001b[0m\n",
+      "Using yard 0.9.24\u001b[32m (was 0.9.20)\u001b[0m\n",
+      "Using pry-doc 1.0.0\n",
+      "Using pry-rails 0.3.9\n",
+      "Using pry-rescue 1.5.0\n",
+      "Using pry-stack_explorer 0.4.9.3\n",
+      "Using simplecov-html 0.11.0\u001b[32m (was 0.10.2)\u001b[0m\n",
+      "Using simplecov 0.18.1\u001b[32m (was 0.17.1)\u001b[0m\n",
+      "Using thor 1.0.1\n",
+      "\u001b[32mBundle updated!\u001b[0m\n"
+     ]
+    }
+   ],
    "source": [
     "! bundle update"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
+   "execution_count": 7,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "/home/mshira/.rvm/rubies/ruby-2.5.1/bin/ruby -I\"lib:lib\" -I\"/home/mshira/.rvm/gems/ruby-2.5.1/gems/rake-10.1.1/lib\" \"/home/mshira/.rvm/gems/ruby-2.5.1/gems/rake-10.1.1/lib/rake/rake_test_loader.rb\" \"test/unit/messages_test.rb\" \"test/unit/exception_handler_test.rb\" \"test/unit/modules_test.rb\" \"test/unit/connection_test.rb\" \"test/unit/completer_test.rb\" \"test/unit/csv_parser_test.rb\" \"test/unit/option_builder_test.rb\" \"test/unit/utils_test.rb\" \"test/unit/apipie/command_test.rb\" \"test/unit/apipie/option_builder_test.rb\" \"test/unit/apipie/api_connection_test.rb\" \"test/unit/apipie/option_definition_test.rb\" \"test/unit/command_extensions_test.rb\" \"test/unit/main_test.rb\" \"test/unit/options/processor_list_test.rb\" \"test/unit/options/validators/dsl_test.rb\" \"test/unit/options/sources/command_line_test.rb\" \"test/unit/options/sources/saved_defaults_test.rb\" \"test/unit/options/matcher_test.rb\" \"test/unit/options/option_collector_test.rb\" \"test/unit/options/normalizers_test.rb\" \"test/unit/options/option_definition_test.rb\" \"test/unit/settings_test.rb\" \"test/unit/history_test.rb\" \"test/unit/defaults_test.rb\" \"test/unit/logger_test.rb\" \"test/unit/output/formatters_test.rb\" \"test/unit/output/record_collection_test.rb\" \"test/unit/output/dsl_test.rb\" \"test/unit/output/definition_test.rb\" \"test/unit/output/output_test.rb\" \"test/unit/output/field_filter_test.rb\" \"test/unit/output/fields_test.rb\" \"test/unit/output/adapter/table_test.rb\" \"test/unit/output/adapter/json_test.rb\" \"test/unit/output/adapter/abstract_test.rb\" \"test/unit/output/adapter/yaml_test.rb\" \"test/unit/output/adapter/csv_test.rb\" \"test/unit/output/adapter/base_test.rb\" \"test/unit/abstract_test.rb\" \"test/unit/i18n_test.rb\" \"test/unit/bash_test.rb\" \"test/unit/help/definition/section_test.rb\" \"test/unit/help/definition/list_test.rb\" \"test/unit/help/definition/text_test.rb\" \"test/unit/help/definition/abstract_item_test.rb\" \"test/unit/help/definition/note_test.rb\" \"test/unit/help/definition_test.rb\" \"test/unit/help/builder_test.rb\" \"test/unit/help/text_builder_test.rb\" \"test/unit/ca_cert_manager_test.rb\" \"test/functional/help_test.rb\" \"test/functional/nil_values_test.rb\" \"test/functional/defaults_test.rb\" \n",
+      "Mocha deprecation warning at /home/mshira/git/hammer-cli/test/test_helper.rb:14:in `require': Require 'mocha/test_unit', 'mocha/minitest' or 'mocha/api' instead of 'mocha/setup'.\n",
+      "Run options: --seed 52387\n",
+      "\n",
+      "# Running tests:\n",
+      "\n",
+      "..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................\n",
+      "\n",
+      "Finished tests in 0.409490s, 2075.7550 tests/s, 3130.7270 assertions/s.\n",
+      "\n",
+      "850 tests, 1282 assertions, 0 failures, 0 errors, 0 skips\n",
+      "Coverage report generated for MiniTest to /home/mshira/git/coverage. 3092 / 3469 LOC (89.13%) covered.\n"
+     ]
+    }
+   ],
    "source": [
     "! bundle exec rake test"
    ]
@@ -120,7 +241,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 8,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -477,7 +598,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.7.4"
+   "version": "3.7.5"
   }
  },
  "nbformat": 4,

Commit changes


In [13]:
! git commit -m "Bump to {NEW_VERSION}"


[master 71f251a] Bump to 2.0.0
 3 files changed, 164 insertions(+), 28 deletions(-)

Update translations


In [18]:
if MAJOR_RELEASE:
    ! make -C locale/ tx-update


make: Entering directory '/home/mshira/git/hammer-cli/locale'
bundle exec rake gettext:find
(in /home/mshira/git/hammer-cli)
touch /home/mshira/git/hammer-cli/lib/hammer_cli/../../locale/es/hammer-cli.po.time_stamp
touch /home/mshira/git/hammer-cli/lib/hammer_cli/../../locale/de/hammer-cli.po.time_stamp
touch /home/mshira/git/hammer-cli/lib/hammer_cli/../../locale/en_GB/hammer-cli.po.time_stamp
tx pull -f
tx INFO: Pulling translations for resource foreman.hammer-cli (source: locale/hammer-cli.pot)
tx INFO:  -> it: locale/it/hammer-cli.edit.po
tx INFO:  -> pt_BR: locale/pt_BR/hammer-cli.edit.po
tx INFO:  -> ko: locale/ko/hammer-cli.edit.po
tx INFO:  -> ja: locale/ja/hammer-cli.edit.po
tx INFO:  -> de: locale/de/hammer-cli.edit.po
tx INFO:  -> ca: locale/ca/hammer-cli.edit.po
tx INFO:  -> zh_TW: locale/zh_TW/hammer-cli.edit.po
tx INFO:  -> en_GB: locale/en_GB/hammer-cli.edit.po
tx INFO:  -> fr: locale/fr/hammer-cli.edit.po
tx INFO:  -> ru: locale/ru/hammer-cli.edit.po
tx INFO:  -> zh_CN: locale/zh_CN/hammer-cli.edit.po
tx INFO:  -> es: locale/es/hammer-cli.edit.po
tx INFO: Done.
for f in ./ja/hammer-cli.edit.po ./es/hammer-cli.edit.po ./pt_BR/hammer-cli.edit.po ./en/hammer-cli.edit.po ./de/hammer-cli.edit.po ./it/hammer-cli.edit.po ./zh_CN/hammer-cli.edit.po ./ca/hammer-cli.edit.po ./fr/hammer-cli.edit.po ./ko/hammer-cli.edit.po ./zh_TW/hammer-cli.edit.po ./en_GB/hammer-cli.edit.po ./ru/hammer-cli.edit.po; do \
	sed -i 's/^\("Project-Id-Version: \).*$/\1hammer-cli 2.0.0\\n"/' $f; \
done
for f in ./ja/hammer-cli.edit.po ./es/hammer-cli.edit.po ./pt_BR/hammer-cli.edit.po ./en/hammer-cli.edit.po ./de/hammer-cli.edit.po ./it/hammer-cli.edit.po ./zh_CN/hammer-cli.edit.po ./ca/hammer-cli.edit.po ./fr/hammer-cli.edit.po ./ko/hammer-cli.edit.po ./zh_TW/hammer-cli.edit.po ./en_GB/hammer-cli.edit.po ./ru/hammer-cli.edit.po; do \
	msgcat --use-first --no-location $f ${f//.edit/} > ${f//.edit/}; \
done
mkdir -p ja/LC_MESSAGES
msgfmt -o ja/LC_MESSAGES/hammer-cli.mo ja/hammer-cli.po
mkdir -p es/LC_MESSAGES
msgfmt -o es/LC_MESSAGES/hammer-cli.mo es/hammer-cli.po
mkdir -p pt_BR/LC_MESSAGES
msgfmt -o pt_BR/LC_MESSAGES/hammer-cli.mo pt_BR/hammer-cli.po
mkdir -p en/LC_MESSAGES
msgfmt -o en/LC_MESSAGES/hammer-cli.mo en/hammer-cli.po
mkdir -p de/LC_MESSAGES
msgfmt -o de/LC_MESSAGES/hammer-cli.mo de/hammer-cli.po
mkdir -p it/LC_MESSAGES
msgfmt -o it/LC_MESSAGES/hammer-cli.mo it/hammer-cli.po
mkdir -p zh_CN/LC_MESSAGES
msgfmt -o zh_CN/LC_MESSAGES/hammer-cli.mo zh_CN/hammer-cli.po
mkdir -p ca/LC_MESSAGES
msgfmt -o ca/LC_MESSAGES/hammer-cli.mo ca/hammer-cli.po
mkdir -p fr/LC_MESSAGES
msgfmt -o fr/LC_MESSAGES/hammer-cli.mo fr/hammer-cli.po
mkdir -p ko/LC_MESSAGES
msgfmt -o ko/LC_MESSAGES/hammer-cli.mo ko/hammer-cli.po
mkdir -p zh_TW/LC_MESSAGES
msgfmt -o zh_TW/LC_MESSAGES/hammer-cli.mo zh_TW/hammer-cli.po
mkdir -p en_GB/LC_MESSAGES
msgfmt -o en_GB/LC_MESSAGES/hammer-cli.mo en_GB/hammer-cli.po
mkdir -p ru/LC_MESSAGES
msgfmt -o ru/LC_MESSAGES/hammer-cli.mo ru/hammer-cli.po
git add ../locale
git commit -m "i18n - extracting new, pulling from tx"
[master 480a4a0] i18n - extracting new, pulling from tx
 27 files changed, 93 insertions(+), 75 deletions(-)
Changes commited!
make: Leaving directory '/home/mshira/git/hammer-cli/locale'

Tag new version


In [15]:
! git tag {NEW_VERSION}

Prepare stable branch for major release


In [19]:
if MAJOR_RELEASE:
    ! git checkout -b {STABLE_BRANCH}
    ! git push {GIT_REMOTE_UPSTREAM} {STABLE_BRANCH}
    ! git checkout {WORK_BRANCH}


M	rel-eng/gem_release.ipynb
Switched to a new branch '2.0-stable'
Enumerating objects: 107, done.
Counting objects: 100% (107/107), done.
Delta compression using up to 8 threads
Compressing objects: 100% (52/52), done.
Writing objects: 100% (65/65), 66.35 KiB | 3.69 MiB/s, done.
Total 65 (delta 26), reused 0 (delta 0)
remote: Resolving deltas: 100% (26/26), completed with 13 local objects.
remote: 
remote: Create a pull request for '2.0-stable' on GitHub by visiting:
remote:      https://github.com/theforeman/hammer-cli/pull/new/2.0-stable
remote: 
To github.com:theforeman/hammer-cli.git
 * [new branch]      2.0-stable -> 2.0-stable
M	rel-eng/gem_release.ipynb
Switched to branch 'master'

Build the gem


In [20]:
! rake build


hammer_cli 2.0.0 built to pkg/hammer_cli-2.0.0.gem.

In [ ]:
! gem push pkg/hammer_cli-{NEW_VERSION}.gem

Bump the develop version for major release


In [ ]:
if MAJOR_RELEASE:
    ! sed -i 's/Gem::Version.new .*/Gem::Version.new "{DEVELOP_VERSION}"/' lib/hammer_cli/version.rb

In [ ]:
if MAJOR_RELEASE:
    ! git add -u
    ! git status

In [ ]:
if MAJOR_RELEASE:
    ! git diff --cached

In [ ]:
if MAJOR_RELEASE:
    ! git commit -m "Bump to {DEVELOP_VERSION}"

PUSH the changes upstream If everything is correct


In [ ]:
! git push {GIT_REMOTE_UPSTREAM} {WORK_BRANCH}

In [ ]:
! git push --tags {GIT_REMOTE_UPSTREAM} {WORK_BRANCH}

Now the new release is in upstream repo

Some manual steps follow to improve the UX

New relase on GitHub

Copy the following changelog lines to the description in form on link below The release title is the new version.


In [ ]:
print('\n')
print('\n'.join(change_log))
print('\n\nhttps://github.com/theforeman/hammer-cli/releases/new?tag=%s' % NEW_VERSION)

In [ ]:
from IPython.display import Markdown as md

md('### Create new hammer-cli release in Redmine \n' + \
    '<a href="https://projects.theforeman.org/projects/hammer-cli/versions/new" target="_blank">https://projects.theforeman.org/projects/hammer-cli/versions/new</a>\n\n' + \
    'Set name to hammer-cli-%s' % (NEXT_FUTURE_VERSION if MAJOR_RELEASE else NEW_VERSION))

In [ ]:
if not MAJOR_RELEASE:
    print('Set fixed in versions to %s in following issues:' % NEW_VERSION)
    for i in referenced_issues:
        print('- https://projects.theforeman.org/issues/%s' % i)

Congratulations

Release is public now.