Skip to content

Commit

Permalink
Update local testing
Browse files Browse the repository at this point in the history
  • Loading branch information
kpaulisse committed Oct 15, 2017
1 parent af58bc1 commit 61cd024
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 46 deletions.
23 changes: 6 additions & 17 deletions doc/dev/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,13 @@ The project maintainers are responsible for bumping the version number, regenera

*This procedure is performed by a GitHubber.*

To test the new version of `octocatalog-diff` in the GitHub Puppet repository:
To test the new version of `octocatalog-diff` in the GitHub Puppet repository, check out `github/puppet` and:

0. In a checkout of the GitHub Puppet repository, start a new branch based off master.
0. In the `octocatalog-diff` checkout:
- Ensure that the desired branch is checked out.
- Choose a unique internal version number which has never been used in CI. A good guideline is that if you're planning to release a version `0.6.0` then for these tests, use `0.6.0a`, `0.6.0b`, ...
- Build the gem using your internal version number:

```
OCTOCATALOG_DIFF_VERSION=0.6.0a rake gem:force-build
```
- Run the task to install the gem into your Puppet checkout:
```
OCTOCATALOG_DIFF_VERSION=0.6.0a rake gem:localinstall
```
0. Back in the Puppet checkout, ensure that the changes are as expected (updates to Gemfile / Gemfile.lock, addition of new gem). Push the change and build appropriate CI job(s) to validate the changes.
- Start a new branch based off master
- Run `script/update-octocatalog-diff -r <ocd_branch_name>`
- Confirm and commit the result
- Make sure all CI jobs pass
- Run the `puppet-catalog-diff` CI job and make sure it passes and shows expected results

## Merging one PR

Expand Down
3 changes: 1 addition & 2 deletions octocatalog-diff.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require_relative 'lib/octocatalog-diff/version'
require 'json'

DEFAULT_PUPPET_VERSION = '4.10.8'.freeze
Expand All @@ -7,7 +6,7 @@ Gem::Specification.new do |s|
s.required_ruby_version = '>= 2.0.0'

s.name = 'octocatalog-diff'
s.version = ENV['OCTOCATALOG_DIFF_VERSION'] || OctocatalogDiff::Version::VERSION
s.version = ENV['OCTOCATALOG_DIFF_VERSION'] || File.read(File.join(File.dirname(__FILE__), '.version')).strip
s.license = 'MIT'
s.authors = ['GitHub, Inc.', 'Kevin Paulisse']
s.email = 'opensource+octocatalog-diff@github.com'
Expand Down
27 changes: 0 additions & 27 deletions rake/gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,31 +128,4 @@ def self.exec_command(command)
task 'yank' do
OctocatalogDiff::Gem.yank
end

# These tasks are specific to a GitHub development environment and will likely not be effective
# in other environments. Specifically this is intended to copy the gem to, and adjust the Gemfile
# of, a checkout of GitHub's puppet repo in a parallel directory.
task 'local' do
Rake::Task['gem:force-build'].invoke
Rake::Task['gem:localinstall'].invoke
end

task 'localinstall' do
script = File.expand_path('../../puppet/script/octocatalog-diff-update.sh', File.dirname(__FILE__))
raise "Cannot execute 'localinstall': script '#{script}' is missing" unless File.file?(script)

# Make sure the gem has been built
branch = OctocatalogDiff::Gem.branch
version = OctocatalogDiff::Gem.version
gemfile = if branch == 'master'
OctocatalogDiff::Gem::FINAL_GEMFILE
else
File.join(OctocatalogDiff::Gem::PKGDIR, "octocatalog-diff-#{version}-#{branch}.gem")
end
raise "Cannot execute 'localinstall': gem '#{gemfile}' has not been built" unless File.file?(gemfile)

# Execute the installation command
command = [script, gemfile, version].map { |x| Shellwords.escape(x) }.join(' ')
system command
end
end

0 comments on commit 61cd024

Please sign in to comment.