puppet-autostager 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/autostager/version.rb +1 -2
- metadata +3 -26
- data/.editorconfig +0 -14
- data/.gitignore +0 -17
- data/.rubocop.yml +0 -14
- data/CONTRIBUTING.md +0 -32
- data/Gemfile +0 -4
- data/LICENSE.txt +0 -22
- data/README.md +0 -63
- data/Rakefile +0 -51
- data/assets/rubygems-workflow.png +0 -0
- data/autostager.gemspec +0 -34
- data/circle.yml +0 -19
- data/script/bootstrap +0 -10
- data/script/functions +0 -10
- data/script/push.sh +0 -20
- data/script/test +0 -8
- data/spec/functional/placeholder_spec.rb +0 -2
- data/spec/spec_helper.rb +0 -27
- data/spec/unit/autostager_spec.rb +0 -33
- data/src/publish +0 -22
- data/templates/credentials +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f1503161e2d1ebe792060c5307f6ccad79726ef
|
4
|
+
data.tar.gz: 0da996b1091566ec07653081a86eb4e6bde33f98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4cef3c12a9009afaa1ee3e95fed566f22c612c45b155b45d0335cc696f37ffb763212c3187ab8ee4a3e3105b7d452453a48c237f4b8c935c040fa72bb3eb9fb
|
7
|
+
data.tar.gz: 38cdca3bd3648d8a2ccc3e50b79f3d4f54b6c942903983ab64dde8b9d801315ba0f8b926c1262729ae8e8a1c081969120725f5d97e5be894f91bdb41fb5a0052
|
data/lib/autostager/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-autostager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Morgan
|
@@ -192,18 +192,7 @@ executables:
|
|
192
192
|
extensions: []
|
193
193
|
extra_rdoc_files: []
|
194
194
|
files:
|
195
|
-
- ".editorconfig"
|
196
|
-
- ".gitignore"
|
197
|
-
- ".rubocop.yml"
|
198
|
-
- CONTRIBUTING.md
|
199
|
-
- Gemfile
|
200
|
-
- LICENSE.txt
|
201
|
-
- README.md
|
202
|
-
- Rakefile
|
203
|
-
- assets/rubygems-workflow.png
|
204
|
-
- autostager.gemspec
|
205
195
|
- bin/autostager
|
206
|
-
- circle.yml
|
207
196
|
- lib/autostager.rb
|
208
197
|
- lib/autostager/cli.rb
|
209
198
|
- lib/autostager/git_timeout.rb
|
@@ -211,15 +200,6 @@ files:
|
|
211
200
|
- lib/autostager/pull_request.rb
|
212
201
|
- lib/autostager/timeout.rb
|
213
202
|
- lib/autostager/version.rb
|
214
|
-
- script/bootstrap
|
215
|
-
- script/functions
|
216
|
-
- script/push.sh
|
217
|
-
- script/test
|
218
|
-
- spec/functional/placeholder_spec.rb
|
219
|
-
- spec/spec_helper.rb
|
220
|
-
- spec/unit/autostager_spec.rb
|
221
|
-
- src/publish
|
222
|
-
- templates/credentials
|
223
203
|
homepage: https://github.com/jumanjiman/autostager
|
224
204
|
licenses:
|
225
205
|
- MIT
|
@@ -240,11 +220,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
240
220
|
version: '0'
|
241
221
|
requirements: []
|
242
222
|
rubyforge_project:
|
243
|
-
rubygems_version: 2.6.
|
223
|
+
rubygems_version: 2.6.12
|
244
224
|
signing_key:
|
245
225
|
specification_version: 4
|
246
226
|
summary: Create a puppet enviroment for each pull request
|
247
|
-
test_files:
|
248
|
-
- spec/functional/placeholder_spec.rb
|
249
|
-
- spec/spec_helper.rb
|
250
|
-
- spec/unit/autostager_spec.rb
|
227
|
+
test_files: []
|
data/.editorconfig
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
; This file is for unifying the coding style for different editors and IDEs.
|
2
|
-
; Plugins are available for notepad++, emacs, vim, gedit,
|
3
|
-
; textmate, visual studio, and more.
|
4
|
-
;
|
5
|
-
; See http://editorconfig.org for details.
|
6
|
-
|
7
|
-
root = true
|
8
|
-
|
9
|
-
[*]
|
10
|
-
indent_style = space
|
11
|
-
indent_size = 2
|
12
|
-
end_of_line = lf
|
13
|
-
insert_final_newline = true
|
14
|
-
trim_trailing_whitespace = true
|
data/.gitignore
DELETED
data/.rubocop.yml
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
---
|
2
|
-
AllCops:
|
3
|
-
Exclude:
|
4
|
-
- 'Dockerfile*'
|
5
|
-
|
6
|
-
# Avoid diff-churn!
|
7
|
-
Style/TrailingCommaInArguments:
|
8
|
-
Description: 'Checks for trailing comma in argument lists.'
|
9
|
-
Enabled: true
|
10
|
-
EnforcedStyleForMultiline: comma
|
11
|
-
Style/TrailingCommaInLiteral:
|
12
|
-
Description: 'Checks for trailing comma in array and hash literals.'
|
13
|
-
Enabled: true
|
14
|
-
EnforcedStyleForMultiline: comma
|
data/CONTRIBUTING.md
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
Contributing
|
2
|
-
============
|
3
|
-
|
4
|
-
1. Fork it
|
5
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
6
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
7
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
8
|
-
5. Create new Pull Request
|
9
|
-
|
10
|
-
|
11
|
-
Diff churn
|
12
|
-
----------
|
13
|
-
|
14
|
-
Please minimize diff churn to enhance git history commands.
|
15
|
-
|
16
|
-
* Arrays should usually be multi-line with trailing commas.
|
17
|
-
|
18
|
-
Update `.rubocop.yml` if necessary to favor minimal churn.
|
19
|
-
|
20
|
-
|
21
|
-
Linear history
|
22
|
-
--------------
|
23
|
-
|
24
|
-
Use `git rebase upstream/master` to update your branch.
|
25
|
-
|
26
|
-
* You **must** force-push after rebasing.
|
27
|
-
* We **never force-push** to master.
|
28
|
-
|
29
|
-
The primary reason for this is to maintain a clean, linear history
|
30
|
-
via "fast-forward" merges to master.
|
31
|
-
A clean, linear history in master makes it easier
|
32
|
-
to troubleshoot regressions and follow the timeline.
|
data/Gemfile
DELETED
data/LICENSE.txt
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2014 Paul Morgan
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
Autostager
|
2
|
-
==========
|
3
|
-
|
4
|
-
Automatically stage a local directory based on Github pull request.
|
5
|
-
|
6
|
-
Build status for master branch: [![Circle CI](https://circleci.com/gh/jumanjihouse/autostager/tree/master.svg?style=svg&circle-token=a5b167be1f709009108ca0aaec1613fd9e843cc1)](https://circleci.com/gh/jumanjihouse/autostager/tree/master)
|
7
|
-
|
8
|
-
|
9
|
-
Installation
|
10
|
-
------------
|
11
|
-
|
12
|
-
Add this line to your application's Gemfile:
|
13
|
-
|
14
|
-
gem 'puppet-autostager'
|
15
|
-
|
16
|
-
And then execute:
|
17
|
-
|
18
|
-
$ bundle
|
19
|
-
|
20
|
-
Or install it yourself as:
|
21
|
-
|
22
|
-
$ gem install puppet-autostager
|
23
|
-
|
24
|
-
|
25
|
-
Usage
|
26
|
-
-----
|
27
|
-
|
28
|
-
Create an access token as described at
|
29
|
-
https://github.com/octokit/octokit.rb#oauth-access-tokens
|
30
|
-
then export a few environment variables:
|
31
|
-
|
32
|
-
```
|
33
|
-
export repo_slug=ISEexchange/puppet
|
34
|
-
export access_token=<your 40-char token>
|
35
|
-
export base_dir=/tmp/puppet/environments
|
36
|
-
export debug=anything
|
37
|
-
|
38
|
-
# Set a timeout for git operations (default 120 seconds).
|
39
|
-
export timeout=180
|
40
|
-
|
41
|
-
# Override the default 30 second interval.
|
42
|
-
export sleep_interval=60
|
43
|
-
|
44
|
-
# Or run as a single-shot operation.
|
45
|
-
export sleep_interval=0
|
46
|
-
```
|
47
|
-
|
48
|
-
Then run:
|
49
|
-
|
50
|
-
```
|
51
|
-
autostager
|
52
|
-
```
|
53
|
-
|
54
|
-
|
55
|
-
Build workflow
|
56
|
-
--------------
|
57
|
-
|
58
|
-
We use CircleCI to build and publish to rubygems.org:
|
59
|
-
|
60
|
-
![simplified workflow](assets/rubygems-workflow.png)
|
61
|
-
|
62
|
-
If build is clean on master branch, CircleCI pushes the
|
63
|
-
built gem to [https://rubygems.org/gems/puppet-autostager](https://rubygems.org/gems/puppet-autostager).
|
data/Rakefile
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
# vim: set ts=2 sw=2 ai et:
|
2
|
-
|
3
|
-
# Does the current user have root privileges?
|
4
|
-
#
|
5
|
-
# @return [Boolean] true if user can exercise root privileges;
|
6
|
-
# false if user does not have privileges OR we're on a
|
7
|
-
# non-posix platform
|
8
|
-
def got_root?
|
9
|
-
# attempt to exercise privilege
|
10
|
-
Process::Sys.setuid(0)
|
11
|
-
true
|
12
|
-
rescue Errno::EPERM
|
13
|
-
false
|
14
|
-
end
|
15
|
-
|
16
|
-
abort 'Must not run as root' if got_root?
|
17
|
-
|
18
|
-
require 'bundler/gem_tasks'
|
19
|
-
require 'bundler/setup'
|
20
|
-
require 'bundler/settings'
|
21
|
-
require 'rspec/core/rake_task'
|
22
|
-
require 'rubocop/rake_task'
|
23
|
-
require 'fileutils'
|
24
|
-
|
25
|
-
task default: [:help]
|
26
|
-
|
27
|
-
desc 'Display the list of available rake tasks'
|
28
|
-
task :help do
|
29
|
-
system('rake -T')
|
30
|
-
end
|
31
|
-
|
32
|
-
# Run unit tests before functional tests.
|
33
|
-
desc 'Run rspec tests'
|
34
|
-
task test: %i[
|
35
|
-
rubocop
|
36
|
-
unit
|
37
|
-
functional
|
38
|
-
]
|
39
|
-
|
40
|
-
RSpec::Core::RakeTask.new(:unit) do |t|
|
41
|
-
t.pattern = 'spec/unit/**/*_spec.rb'
|
42
|
-
end
|
43
|
-
|
44
|
-
RSpec::Core::RakeTask.new(:functional) do |t|
|
45
|
-
t.pattern = 'spec/functional/**/*_spec.rb'
|
46
|
-
end
|
47
|
-
|
48
|
-
desc 'Run RuboCop'
|
49
|
-
RuboCop::RakeTask.new(:rubocop) do |t|
|
50
|
-
t.options.unshift '--display-cop-names'
|
51
|
-
end
|
Binary file
|
data/autostager.gemspec
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
lib = File.expand_path('../lib', __FILE__)
|
2
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require 'English'
|
4
|
-
require 'autostager/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = 'puppet-autostager'
|
8
|
-
spec.version = Autostager::VERSION
|
9
|
-
spec.authors = ['Paul Morgan']
|
10
|
-
spec.email = ['jumanjiman@gmail.com']
|
11
|
-
spec.description = 'Create a puppet enviroment for each pull request'
|
12
|
-
spec.summary = 'Create a puppet enviroment for each pull request'
|
13
|
-
spec.homepage = 'https://github.com/jumanjiman/autostager'
|
14
|
-
spec.license = 'MIT'
|
15
|
-
|
16
|
-
spec.files = `git ls-files`.split($RS)
|
17
|
-
spec.executables = spec.files.grep(%r{^bin\/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)\/})
|
19
|
-
spec.require_paths = ['lib']
|
20
|
-
|
21
|
-
spec.add_development_dependency 'bundler', '~> 1.3'
|
22
|
-
spec.add_development_dependency 'minitest'
|
23
|
-
spec.add_development_dependency 'mocha'
|
24
|
-
spec.add_development_dependency 'rake'
|
25
|
-
spec.add_development_dependency 'rspec-core'
|
26
|
-
spec.add_development_dependency 'rspec', '>= 3.0', '<= 4.0'
|
27
|
-
spec.add_development_dependency 'rspec-expectations'
|
28
|
-
spec.add_development_dependency 'rspec-mocks'
|
29
|
-
spec.add_development_dependency 'rubocop'
|
30
|
-
spec.add_development_dependency 'thor'
|
31
|
-
|
32
|
-
spec.add_dependency 'json'
|
33
|
-
spec.add_dependency 'octokit', '~> 3.0'
|
34
|
-
end
|
data/circle.yml
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
machine:
|
2
|
-
ruby:
|
3
|
-
version: 2.4.0
|
4
|
-
environment:
|
5
|
-
# If you change this, you need to change lib/autostager/version.rb
|
6
|
-
VERSION: 0.0.11
|
7
|
-
|
8
|
-
test:
|
9
|
-
post:
|
10
|
-
- gem build autostager.gemspec
|
11
|
-
|
12
|
-
# https://circleci.com/docs/configuration#deployment
|
13
|
-
# https://circleci.com/docs/environment-variables
|
14
|
-
deployment:
|
15
|
-
master:
|
16
|
-
branch: master
|
17
|
-
owner: jumanjihouse
|
18
|
-
commands:
|
19
|
-
- script/push.sh
|
data/script/bootstrap
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
set -e
|
3
|
-
|
4
|
-
# Import smitty.
|
5
|
-
. script/functions
|
6
|
-
|
7
|
-
git remote show upstream &> /dev/null || smitty git remote add upstream https://github.com/jumanjihouse/autostager.git
|
8
|
-
|
9
|
-
rm -f Gemfile.lock
|
10
|
-
smitty bundle update 2> /dev/null || smitty bundle install --path=~/.bundle
|
data/script/functions
DELETED
data/script/push.sh
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
set -e
|
3
|
-
set -u
|
4
|
-
|
5
|
-
mkdir -p ~/.gem/ || :
|
6
|
-
cp -f templates/credentials ~/.gem/
|
7
|
-
chmod 0600 ~/.gem/credentials
|
8
|
-
sed -i "s/API_KEY/${API_KEY}/" ~/.gem/credentials
|
9
|
-
|
10
|
-
output="$(gem search --remote -a puppet-autostager)"
|
11
|
-
if echo ${output} | grep ${VERSION}; then
|
12
|
-
# Be informative, but don't fail.
|
13
|
-
# This enables to merge changes to non-gem files, such as README.
|
14
|
-
echo "puppet-autostager ${VERSION} has already been published."
|
15
|
-
else
|
16
|
-
gem push puppet-autostager-${VERSION}.gem || {
|
17
|
-
echo ERR: failed to push gem
|
18
|
-
exit 1
|
19
|
-
} >&2
|
20
|
-
fi
|
data/script/test
DELETED
data/spec/spec_helper.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'minitest'
|
2
|
-
require 'mocha/setup'
|
3
|
-
require 'English'
|
4
|
-
require 'tempfile'
|
5
|
-
require 'pp'
|
6
|
-
require 'autostager'
|
7
|
-
|
8
|
-
RSpec.configure do |c|
|
9
|
-
c.mock_with :mocha
|
10
|
-
c.color = true
|
11
|
-
c.formatter = 'doc'
|
12
|
-
|
13
|
-
# Allow both "should" and "expect" syntax.
|
14
|
-
# https://www.relishapp.com/rspec/rspec-expectations/docs/syntax-configuration
|
15
|
-
c.expect_with :rspec do |e|
|
16
|
-
e.syntax = %i[should expect]
|
17
|
-
end
|
18
|
-
|
19
|
-
# Fail overall as soon as first test fails.
|
20
|
-
# Fail fast to reduce duration of test runs.
|
21
|
-
# IOW get out of the way so that the next pull request gets tested.
|
22
|
-
c.fail_fast = true
|
23
|
-
|
24
|
-
# Make it easy for spec tests to find fixtures.
|
25
|
-
c.add_setting :fixture_path, default: nil
|
26
|
-
c.fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))
|
27
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Autostager do
|
4
|
-
describe 'timeout_seconds' do
|
5
|
-
it 'defaults to 120 seconds' do
|
6
|
-
ENV['timeout'] = nil
|
7
|
-
Autostager.timeout_seconds.should eql(120)
|
8
|
-
end
|
9
|
-
|
10
|
-
it 'should use ENV["timeout"] if exists' do
|
11
|
-
ENV['timeout'] = '1'
|
12
|
-
Autostager.timeout_seconds.should eql(1)
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'fails if timeout is zero' do
|
16
|
-
ENV['timeout'] = '0'
|
17
|
-
expect { Autostager.timeout_seconds }.to raise_error(RuntimeError)
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'fails if timeout is negative' do
|
21
|
-
ENV['timeout'] = '-5'
|
22
|
-
expect { Autostager.timeout_seconds }.to raise_error(RuntimeError)
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'dynamically adjusts based on env var' do
|
26
|
-
ENV['timeout'] = '1'
|
27
|
-
Autostager.timeout_seconds.should eql(1)
|
28
|
-
|
29
|
-
ENV['timeout'] = '2'
|
30
|
-
Autostager.timeout_seconds.should eql(2)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
data/src/publish
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
set -e
|
3
|
-
set -u
|
4
|
-
|
5
|
-
. vars
|
6
|
-
|
7
|
-
mkdir -p ~/.gem/ || :
|
8
|
-
cp -f credentials ~/.gem/
|
9
|
-
chmod 0600 ~/.gem/credentials
|
10
|
-
sed -i "s/API_KEY/${API_KEY}/" ~/.gem/credentials
|
11
|
-
|
12
|
-
output="$(gem search --remote -a puppet-autostager)"
|
13
|
-
if echo ${output} | grep ${VERSION}; then
|
14
|
-
# Be informative, but don't fail.
|
15
|
-
# This enables to merge changes to non-gem files, such as README.
|
16
|
-
echo "puppet-autostager ${VERSION} has already been published."
|
17
|
-
else
|
18
|
-
gem push puppet-autostager-${VERSION}.gem || {
|
19
|
-
echo ERR: failed to push gem
|
20
|
-
exit 1
|
21
|
-
} >&2
|
22
|
-
fi
|
data/templates/credentials
DELETED