poise-application-git 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +56 -23
- data/CHANGELOG.md +4 -0
- data/Gemfile +3 -2
- data/README.md +2 -2
- data/Rakefile +1 -1
- data/lib/poise-application-git.rb +1 -1
- data/lib/poise_application_git.rb +1 -1
- data/lib/poise_application_git/cheftie.rb +1 -1
- data/lib/poise_application_git/resource.rb +7 -137
- data/lib/poise_application_git/version.rb +2 -2
- data/poise-application-git.gemspec +3 -4
- data/test/cookbook/metadata.rb +1 -1
- data/test/cookbook/recipes/default.rb +1 -1
- data/test/gemfiles/chef-12.1.gemfile +5 -1
- data/{lib/poise_application_git/safe_string.rb → test/gemfiles/chef-12.10.gemfile} +7 -9
- data/test/gemfiles/chef-12.11.gemfile +23 -0
- data/test/gemfiles/chef-12.12.gemfile +22 -0
- data/test/gemfiles/chef-12.13.gemfile +22 -0
- data/test/gemfiles/chef-12.14.gemfile +19 -0
- data/test/gemfiles/chef-12.15.gemfile +19 -0
- data/test/gemfiles/chef-12.16.gemfile +19 -0
- data/test/gemfiles/chef-12.17.gemfile +19 -0
- data/test/gemfiles/{chef-12.0.gemfile → chef-12.18.gemfile} +2 -2
- data/{Berksfile → test/gemfiles/chef-12.19.gemfile} +3 -3
- data/test/gemfiles/chef-12.2.gemfile +5 -1
- data/test/gemfiles/chef-12.3.gemfile +5 -1
- data/test/gemfiles/chef-12.4.gemfile +6 -3
- data/test/gemfiles/chef-12.5.gemfile +5 -1
- data/test/gemfiles/chef-12.6.gemfile +5 -1
- data/test/gemfiles/chef-12.7.gemfile +23 -0
- data/test/gemfiles/chef-12.8.gemfile +23 -0
- data/test/gemfiles/chef-12.9.gemfile +23 -0
- data/test/gemfiles/chef-12.gemfile +2 -2
- data/test/gemfiles/master.gemfile +4 -1
- data/test/integration/default/serverspec/default_spec.rb +1 -1
- data/test/spec/resource_spec.rb +18 -69
- data/test/spec/spec_helper.rb +4 -1
- metadata +53 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 664a831ed6f3cedcb01487ceffc2c5ff5bd2afe6
|
4
|
+
data.tar.gz: 8bb88912c20ee52799436ce33613ae4767d9d4a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c836d81f50d027f1be9c97be8129cb3c7fbcbccf57c94c388a4bc90682b443b0decbd5a16f082095a4a7085e1e28c76597a4422c71f8ec5ed01a06b0debf41d
|
7
|
+
data.tar.gz: 3b8641f6ce99dae380585efbfa3fcca3aa9ac2f0b7cd892ae3d2a9162c94104bd81ef6bb7d190defa40de8d60c7f62bc0034464c9246e2b381954041bb751e19
|
data/.travis.yml
CHANGED
@@ -1,29 +1,62 @@
|
|
1
|
-
---
|
2
1
|
sudo: false
|
3
2
|
cache: bundler
|
4
3
|
language: ruby
|
5
|
-
rvm:
|
6
|
-
- '2.2'
|
7
|
-
addons:
|
8
|
-
apt:
|
9
|
-
packages:
|
10
|
-
- libgecode-dev
|
11
4
|
env:
|
12
5
|
global:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
6
|
+
- secure: AtUneb2rU3NtqZH3LULBSib7x/wgGpj6k4N6LZGwkAa6HztKI0tcV/OhKw90SlwhUDKTfYtH9ZMDEi5xfy53tCjL8iaRJsQsq6cs+UxRYQRtecHynJaiNjcxNfH2sKcDBcYRDXYJ/6TAG2PPa3jnXGdhv5sqOAKWeiKBUSIil1M=
|
7
|
+
- secure: IaXKhWRDmQ6o5a9iefVdoUgQedy4c4Tvr+/v3WxXPcZi92h2mqObJ3JGgvoznaRXn8PKeQfhYdmPT1JS4fAJJ7cHWTxIAY1xqxqu2FJzdjFV9+SyA57r1UrNNaqRvS9Uz3BGRAb1Uy0zcBSPUXJzbhOwmiPr2qLVbFy2hfKHY3g=
|
8
|
+
- secure: CavdSArLFhILYs0HGT0aIQIo7HjswATbIo6M1RDCF7fLPueWR1JtJQRcBlBkR+dR3irmyN+35HieKa4TbQJPm33oPuCHgNvPJFAosyjOh9ifwxXfiMwaBZpmdzAJ1tx3w2XFQlCpIYWW5Re8qeayP8ks2nFEIZw2GROgtYsVxzM=
|
9
|
+
before_install:
|
10
|
+
- 'if [[ $BUNDLE_GEMFILE == *master.gemfile ]]; then gem update --system; fi'
|
11
|
+
- gem --version
|
12
|
+
- gem install bundler
|
13
|
+
- bundle --version
|
14
|
+
- 'bundle config --local path ${BUNDLE_PATH:-$(dirname $BUNDLE_GEMFILE)/vendor/bundle}'
|
15
|
+
- bundle config --local bin $PWD/bin
|
16
|
+
install: bundle update --jobs=3 --retry=3
|
18
17
|
script:
|
19
|
-
-
|
20
|
-
|
21
|
-
|
22
|
-
-
|
23
|
-
|
24
|
-
-
|
25
|
-
|
26
|
-
-
|
27
|
-
|
28
|
-
-
|
29
|
-
|
18
|
+
- ./bin/rake travis
|
19
|
+
matrix:
|
20
|
+
include:
|
21
|
+
- rvm: 2.3.1
|
22
|
+
gemfile: test/gemfiles/chef-12.gemfile
|
23
|
+
- rvm: 2.1.4
|
24
|
+
gemfile: test/gemfiles/chef-12.1.gemfile
|
25
|
+
- rvm: 2.1.4
|
26
|
+
gemfile: test/gemfiles/chef-12.2.gemfile
|
27
|
+
- rvm: 2.1.4
|
28
|
+
gemfile: test/gemfiles/chef-12.3.gemfile
|
29
|
+
- rvm: 2.1.6
|
30
|
+
gemfile: test/gemfiles/chef-12.4.gemfile
|
31
|
+
- rvm: 2.1.6
|
32
|
+
gemfile: test/gemfiles/chef-12.5.gemfile
|
33
|
+
- rvm: 2.1.6
|
34
|
+
gemfile: test/gemfiles/chef-12.6.gemfile
|
35
|
+
- rvm: 2.1.6
|
36
|
+
gemfile: test/gemfiles/chef-12.7.gemfile
|
37
|
+
- rvm: 2.1.6
|
38
|
+
gemfile: test/gemfiles/chef-12.8.gemfile
|
39
|
+
- rvm: 2.1.8
|
40
|
+
gemfile: test/gemfiles/chef-12.9.gemfile
|
41
|
+
- rvm: 2.1.8
|
42
|
+
gemfile: test/gemfiles/chef-12.10.gemfile
|
43
|
+
- rvm: 2.1.8
|
44
|
+
gemfile: test/gemfiles/chef-12.11.gemfile
|
45
|
+
- rvm: 2.1.8
|
46
|
+
gemfile: test/gemfiles/chef-12.12.gemfile
|
47
|
+
- rvm: 2.1.9
|
48
|
+
gemfile: test/gemfiles/chef-12.13.gemfile
|
49
|
+
- rvm: 2.3.1
|
50
|
+
gemfile: test/gemfiles/chef-12.14.gemfile
|
51
|
+
- rvm: 2.3.1
|
52
|
+
gemfile: test/gemfiles/chef-12.15.gemfile
|
53
|
+
- rvm: 2.3.1
|
54
|
+
gemfile: test/gemfiles/chef-12.16.gemfile
|
55
|
+
- rvm: 2.3.1
|
56
|
+
gemfile: test/gemfiles/chef-12.17.gemfile
|
57
|
+
- rvm: 2.3.1
|
58
|
+
gemfile: test/gemfiles/chef-12.18.gemfile
|
59
|
+
- rvm: 2.3.1
|
60
|
+
gemfile: test/gemfiles/chef-12.19.gemfile
|
61
|
+
- rvm: 2.4.1
|
62
|
+
gemfile: test/gemfiles/master.gemfile
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Application_Git Changelog
|
2
2
|
|
3
|
+
## v1.2.0
|
4
|
+
|
5
|
+
* Major refactor on top of poise-git but should be invisible to users.
|
6
|
+
|
3
7
|
## v1.1.0
|
4
8
|
|
5
9
|
* [#2](https://github.com/poise/application_git/issues/2) – Inherit user and group values from the parent `application` resource.
|
data/Gemfile
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright 2015-
|
2
|
+
# Copyright 2015-2017, Noah Kantrowitz
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -31,6 +31,7 @@ dev_gem 'halite'
|
|
31
31
|
dev_gem 'poise'
|
32
32
|
dev_gem 'poise-application', path: '../application'
|
33
33
|
dev_gem 'poise-boiler'
|
34
|
+
dev_gem 'poise-git'
|
35
|
+
dev_gem 'poise-languages'
|
34
36
|
dev_gem 'poise-profiler'
|
35
37
|
dev_gem 'poise-service'
|
36
|
-
|
data/README.md
CHANGED
@@ -24,7 +24,7 @@ end
|
|
24
24
|
|
25
25
|
## Requirements
|
26
26
|
|
27
|
-
Chef 12 or newer is required.
|
27
|
+
Chef 12.1 or newer is required.
|
28
28
|
|
29
29
|
## Resources
|
30
30
|
|
@@ -93,7 +93,7 @@ The Poise test server infrastructure is sponsored by [Rackspace](https://rackspa
|
|
93
93
|
|
94
94
|
## License
|
95
95
|
|
96
|
-
Copyright 2015-
|
96
|
+
Copyright 2015-2017, Noah Kantrowitz
|
97
97
|
|
98
98
|
Licensed under the Apache License, Version 2.0 (the "License");
|
99
99
|
you may not use this file except in compliance with the License.
|
data/Rakefile
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright 2015-
|
2
|
+
# Copyright 2015-2017, Noah Kantrowitz
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -14,14 +14,8 @@
|
|
14
14
|
# limitations under the License.
|
15
15
|
#
|
16
16
|
|
17
|
-
require '
|
18
|
-
|
19
|
-
require 'chef/provider'
|
20
|
-
require 'chef/resource'
|
17
|
+
require 'poise_git/resources/poise_git'
|
21
18
|
require 'poise_application/app_mixin'
|
22
|
-
require 'poise_application/resources/application'
|
23
|
-
|
24
|
-
require 'poise_application_git/safe_string'
|
25
19
|
|
26
20
|
|
27
21
|
module PoiseApplicationGit
|
@@ -38,9 +32,10 @@ module PoiseApplicationGit
|
|
38
32
|
# deploy_key data_bag_item('deploy_keys', 'myapp')['key']
|
39
33
|
# end
|
40
34
|
# end
|
41
|
-
class Resource <
|
35
|
+
class Resource < PoiseGit::Resources::PoiseGit::Resource
|
42
36
|
include PoiseApplication::AppMixin
|
43
37
|
provides(:application_git)
|
38
|
+
subclass_providers!
|
44
39
|
|
45
40
|
# @api private
|
46
41
|
def initialize(*args)
|
@@ -48,8 +43,7 @@ module PoiseApplicationGit
|
|
48
43
|
# Because the superclass declares this, we have to as well. Should be
|
49
44
|
# removable at some point when Chef makes everything use the provider
|
50
45
|
# resolver system instead.
|
51
|
-
@resource_name = :application_git
|
52
|
-
@provider = PoiseApplicationGit::Provider
|
46
|
+
@resource_name = :application_git if defined?(@resource_name) && @resource_name
|
53
47
|
# Clear defaults in older versions of Chef.
|
54
48
|
remove_instance_variable(:@group) if instance_variable_defined?(:@group)
|
55
49
|
remove_instance_variable(:@user) if instance_variable_defined?(:@user)
|
@@ -59,10 +53,7 @@ module PoiseApplicationGit
|
|
59
53
|
# Group to run git as. Defaults to the application group.
|
60
54
|
# @return [String, Integer, nil, false]
|
61
55
|
attribute(:group, kind_of: [String, Integer, NilClass, FalseClass], default: lazy { parent && parent.group })
|
62
|
-
|
63
|
-
# Enable strict SSH host key checking. Defaults to false.
|
64
|
-
# @return [Boolean]
|
65
|
-
attribute(:strict_ssh, equal_to: [true, false], default: false)
|
56
|
+
|
66
57
|
# @!attribute user
|
67
58
|
# User to run git as. Defaults to the application owner.
|
68
59
|
# @return [String, Integer, nil, false]
|
@@ -75,130 +66,9 @@ module PoiseApplicationGit
|
|
75
66
|
destination(parent.path)
|
76
67
|
repository(name)
|
77
68
|
end
|
78
|
-
end
|
79
|
-
|
80
|
-
# @!attribute deploy_key
|
81
|
-
# SSH deploy key as either a string value or a path to a key file.
|
82
|
-
# @return [String]
|
83
|
-
def deploy_key(val=nil)
|
84
|
-
# Use a SafeString for literal deploy keys so they aren't shown.
|
85
|
-
val = SafeString.new(val) if val && !deploy_key_is_local?(val)
|
86
|
-
set_or_return(:deploy_key, val, kind_of: String)
|
87
|
-
end
|
88
|
-
|
89
|
-
# Default SSH wrapper path.
|
90
|
-
#
|
91
|
-
# @api private
|
92
|
-
# @return [String]
|
93
|
-
def ssh_wrapper_path
|
94
|
-
@ssh_wrapper_path ||= ::File.expand_path("~#{user}/.ssh/ssh_wrapper_#{Zlib.crc32(name)}")
|
95
|
-
end
|
96
|
-
|
97
|
-
# Guess if the deploy key is a local path or literal value.
|
98
|
-
#
|
99
|
-
# @api private
|
100
|
-
# @param key [String, nil] Key value to check. Defaults to self.key.
|
101
|
-
# @return [Boolean]
|
102
|
-
def deploy_key_is_local?(key=nil)
|
103
|
-
key ||= deploy_key
|
104
|
-
key && key[0] == '/'
|
105
|
-
end
|
106
|
-
|
107
|
-
# Path to deploy key.
|
108
|
-
#
|
109
|
-
# @api private
|
110
|
-
# @return [String]
|
111
|
-
def deploy_key_path
|
112
|
-
@deploy_key_path ||= if deploy_key_is_local?
|
113
|
-
deploy_key
|
114
|
-
else
|
115
|
-
::File.expand_path("~#{user}/.ssh/id_deploy_#{Zlib.crc32(name)}")
|
116
|
-
end
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
# Provider for `application_git`.
|
121
|
-
#
|
122
|
-
# @since 1.0.0
|
123
|
-
# @see Resource
|
124
|
-
# @provides application_git
|
125
|
-
class Provider < Chef::Provider::Git
|
126
|
-
include PoiseApplication::AppMixin
|
127
|
-
provides(:application_git)
|
128
|
-
|
129
|
-
# @api private
|
130
|
-
def initialize(*args)
|
131
69
|
super
|
132
|
-
# Set the SSH wrapper path in a late-binding kind of way. This better
|
133
|
-
# supports situations where the user doesn't exist until Chef converges.
|
134
|
-
new_resource.ssh_wrapper(new_resource.ssh_wrapper_path) if new_resource.deploy_key
|
135
|
-
end
|
136
|
-
|
137
|
-
# @api private
|
138
|
-
def whyrun_supported?
|
139
|
-
false # Just not dealing with this right now
|
140
|
-
end
|
141
|
-
|
142
|
-
# Hack our special login in before load_current_resource runs because that
|
143
|
-
# needs access to the git remote.
|
144
|
-
#
|
145
|
-
# @api private
|
146
|
-
def load_current_resource
|
147
|
-
include_recipe('git')
|
148
|
-
notifying_block do
|
149
|
-
create_dotssh
|
150
|
-
write_deploy_key
|
151
|
-
write_ssh_wrapper
|
152
|
-
end if new_resource.deploy_key
|
153
|
-
super
|
154
|
-
end
|
155
|
-
|
156
|
-
private
|
157
|
-
|
158
|
-
# Create a .ssh folder for the user.
|
159
|
-
#
|
160
|
-
# @return [void]
|
161
|
-
def create_dotssh
|
162
|
-
directory ::File.expand_path("~#{new_resource.user}/.ssh") do
|
163
|
-
owner new_resource.user
|
164
|
-
group new_resource.group
|
165
|
-
mode '755'
|
166
|
-
end
|
167
|
-
end
|
168
|
-
|
169
|
-
# Copy the deploy key to a file if needed.
|
170
|
-
#
|
171
|
-
# @return [void]
|
172
|
-
def write_deploy_key
|
173
|
-
# Check if we have a local path or some actual content
|
174
|
-
return if new_resource.deploy_key_is_local?
|
175
|
-
file new_resource.deploy_key_path do
|
176
|
-
owner new_resource.user
|
177
|
-
group new_resource.group
|
178
|
-
mode '600'
|
179
|
-
content new_resource.deploy_key
|
180
|
-
sensitive true
|
181
|
-
end
|
182
70
|
end
|
183
71
|
|
184
|
-
# Create the SSH wrapper script.
|
185
|
-
#
|
186
|
-
# @return [void]
|
187
|
-
def write_ssh_wrapper
|
188
|
-
# Write out the GIT_SSH script, it should already be enabled above
|
189
|
-
file new_resource.ssh_wrapper_path do
|
190
|
-
owner new_resource.user
|
191
|
-
group new_resource.group
|
192
|
-
mode '700'
|
193
|
-
content %Q{#!/bin/sh\n/usr/bin/env ssh #{'-o "StrictHostKeyChecking=no" ' unless new_resource.strict_ssh}-i "#{new_resource.deploy_key_path}" $@\n}
|
194
|
-
end
|
195
|
-
end
|
196
|
-
|
197
|
-
# Patch back in the `#git` from the git provider. This otherwise conflicts
|
198
|
-
# with the `#git` defined by the DSL, which gets included in such a way
|
199
|
-
# that the DSL takes priority.
|
200
|
-
def git(*args, &block)
|
201
|
-
Chef::Provider::Git.instance_method(:git).bind(self).call(*args, &block)
|
202
|
-
end
|
203
72
|
end
|
73
|
+
|
204
74
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright 2015-
|
2
|
+
# Copyright 2015-2017, Noah Kantrowitz
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -16,5 +16,5 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
module PoiseApplicationGit
|
19
|
-
VERSION = '1.
|
19
|
+
VERSION = '1.2.0'
|
20
20
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright 2015-
|
2
|
+
# Copyright 2015-2017, Noah Kantrowitz
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -34,12 +34,11 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
35
35
|
spec.require_paths = %w{lib}
|
36
36
|
|
37
|
+
spec.add_dependency 'chef', '>= 12.1', '< 14'
|
37
38
|
spec.add_dependency 'halite', '~> 1.0'
|
38
39
|
spec.add_dependency 'poise', '~> 2.0'
|
39
40
|
spec.add_dependency 'poise-application', '~> 5.0'
|
41
|
+
spec.add_dependency 'poise-git', '~> 1.0'
|
40
42
|
|
41
|
-
spec.add_development_dependency 'berkshelf', '~> 4.0'
|
42
43
|
spec.add_development_dependency 'poise-boiler', '~> 1.6'
|
43
|
-
|
44
|
-
spec.metadata['halite_dependencies'] = 'git'
|
45
44
|
end
|
data/test/cookbook/metadata.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright 2015-
|
2
|
+
# Copyright 2015-2017, Noah Kantrowitz
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -17,3 +17,7 @@
|
|
17
17
|
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
18
|
|
19
19
|
gem 'chef', '~> 12.1.2'
|
20
|
+
gem 'rack', '< 2'
|
21
|
+
gem 'foodcritic', '< 8'
|
22
|
+
gem 'fauxhai', '<= 3.9.0'
|
23
|
+
gem 'chefspec', '< 6'
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright
|
2
|
+
# Copyright 2016-2017, Noah Kantrowitz
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -14,12 +14,10 @@
|
|
14
14
|
# limitations under the License.
|
15
15
|
#
|
16
16
|
|
17
|
+
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
19
|
+
gem 'chef', '~> 12.10.24'
|
20
|
+
gem 'rack', '< 2'
|
21
|
+
gem 'foodcritic', '< 8'
|
22
|
+
gem 'fauxhai', '<= 3.9.0'
|
23
|
+
gem 'chefspec', '< 6'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2016-2017, Noah Kantrowitz
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
|
+
|
19
|
+
gem 'chef', '~> 12.11.18'
|
20
|
+
gem 'rack', '< 2'
|
21
|
+
gem 'foodcritic', '< 8'
|
22
|
+
gem 'fauxhai', '<= 3.9.0'
|
23
|
+
gem 'chefspec', '< 6'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2016-2017, Noah Kantrowitz
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
|
+
|
19
|
+
gem 'chef', '~> 12.12.15'
|
20
|
+
gem 'foodcritic', '< 8'
|
21
|
+
gem 'fauxhai', '<= 3.9.0'
|
22
|
+
gem 'chefspec', '< 6'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2016-2017, Noah Kantrowitz
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
|
+
|
19
|
+
gem 'chef', '~> 12.13.37'
|
20
|
+
gem 'foodcritic', '< 8'
|
21
|
+
gem 'fauxhai', '<= 3.9.0'
|
22
|
+
gem 'chefspec', '< 6'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2016-2017, Noah Kantrowitz
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
|
+
|
19
|
+
gem 'chef', '~> 12.14.89'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2016-2017, Noah Kantrowitz
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
|
+
|
19
|
+
gem 'chef', '~> 12.15.19'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2016-2017, Noah Kantrowitz
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
|
+
|
19
|
+
gem 'chef', '~> 12.16.42'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2016-2017, Noah Kantrowitz
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
|
+
|
19
|
+
gem 'chef', '~> 12.17.44'
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright
|
2
|
+
# Copyright 2017, Noah Kantrowitz
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -16,4 +16,4 @@
|
|
16
16
|
|
17
17
|
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
18
|
|
19
|
-
gem 'chef', '~> 12.
|
19
|
+
gem 'chef', '~> 12.18.31'
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright
|
2
|
+
# Copyright 2017, Noah Kantrowitz
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -14,6 +14,6 @@
|
|
14
14
|
# limitations under the License.
|
15
15
|
#
|
16
16
|
|
17
|
-
|
17
|
+
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
18
|
|
19
|
-
|
19
|
+
gem 'chef', '~> 12.19.36'
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright 2015-
|
2
|
+
# Copyright 2015-2017, Noah Kantrowitz
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -17,3 +17,7 @@
|
|
17
17
|
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
18
|
|
19
19
|
gem 'chef', '~> 12.2.1'
|
20
|
+
gem 'rack', '< 2'
|
21
|
+
gem 'foodcritic', '< 8'
|
22
|
+
gem 'fauxhai', '<= 3.9.0'
|
23
|
+
gem 'chefspec', '< 6'
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright 2015-
|
2
|
+
# Copyright 2015-2017, Noah Kantrowitz
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -17,3 +17,7 @@
|
|
17
17
|
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
18
|
|
19
19
|
gem 'chef', '~> 12.3.0'
|
20
|
+
gem 'rack', '< 2'
|
21
|
+
gem 'foodcritic', '< 8'
|
22
|
+
gem 'fauxhai', '<= 3.9.0'
|
23
|
+
gem 'chefspec', '< 6'
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright 2015-
|
2
|
+
# Copyright 2015-2017, Noah Kantrowitz
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -17,5 +17,8 @@
|
|
17
17
|
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
18
|
|
19
19
|
gem 'chef', '~> 12.4.3'
|
20
|
-
|
21
|
-
gem '
|
20
|
+
gem 'rack', '< 2'
|
21
|
+
gem 'foodcritic', '< 8'
|
22
|
+
gem 'fauxhai', '<= 3.9.0'
|
23
|
+
gem 'chefspec', '< 6'
|
24
|
+
gem 'gh', '0.14.0'
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright 2015-
|
2
|
+
# Copyright 2015-2017, Noah Kantrowitz
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -17,3 +17,7 @@
|
|
17
17
|
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
18
|
|
19
19
|
gem 'chef', '~> 12.5.1'
|
20
|
+
gem 'rack', '< 2'
|
21
|
+
gem 'foodcritic', '< 8'
|
22
|
+
gem 'fauxhai', '<= 3.9.0'
|
23
|
+
gem 'chefspec', '< 6'
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright 2015-
|
2
|
+
# Copyright 2015-2017, Noah Kantrowitz
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -17,3 +17,7 @@
|
|
17
17
|
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
18
|
|
19
19
|
gem 'chef', '~> 12.6.0'
|
20
|
+
gem 'rack', '< 2'
|
21
|
+
gem 'foodcritic', '< 8'
|
22
|
+
gem 'fauxhai', '<= 3.9.0'
|
23
|
+
gem 'chefspec', '< 6'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2016-2017, Noah Kantrowitz
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
|
+
|
19
|
+
gem 'chef', '~> 12.7.2'
|
20
|
+
gem 'rack', '< 2'
|
21
|
+
gem 'foodcritic', '< 8'
|
22
|
+
gem 'fauxhai', '<= 3.9.0'
|
23
|
+
gem 'chefspec', '< 6'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2016-2017, Noah Kantrowitz
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
|
+
|
19
|
+
gem 'chef', '~> 12.8.1'
|
20
|
+
gem 'rack', '< 2'
|
21
|
+
gem 'foodcritic', '< 8'
|
22
|
+
gem 'fauxhai', '<= 3.9.0'
|
23
|
+
gem 'chefspec', '< 6'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2016-2017, Noah Kantrowitz
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
|
+
|
19
|
+
gem 'chef', '~> 12.9.41'
|
20
|
+
gem 'rack', '< 2'
|
21
|
+
gem 'foodcritic', '< 8'
|
22
|
+
gem 'fauxhai', '<= 3.9.0'
|
23
|
+
gem 'chefspec', '< 6'
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright 2015-
|
2
|
+
# Copyright 2015-2017, Noah Kantrowitz
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -16,4 +16,4 @@
|
|
16
16
|
|
17
17
|
eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
18
18
|
|
19
|
-
gem 'chef', '~> 12.
|
19
|
+
gem 'chef', '~> 12.19'
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright 2015-
|
2
|
+
# Copyright 2015-2017, Noah Kantrowitz
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -18,7 +18,10 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
|
|
18
18
|
|
19
19
|
gem 'chef', github: 'chef/chef'
|
20
20
|
gem 'halite', github: 'poise/halite'
|
21
|
+
gem 'ohai', github: 'chef/ohai'
|
21
22
|
gem 'poise', github: 'poise/poise'
|
22
23
|
gem 'poise-application', github: 'poise/application'
|
23
24
|
gem 'poise-boiler', github: 'poise/poise-boiler'
|
25
|
+
gem 'poise-git', github: 'poise/poise-git'
|
26
|
+
gem 'poise-languages', github: 'poise/poise-languages'
|
24
27
|
gem 'poise-service', github: 'poise/poise-service'
|
data/test/spec/resource_spec.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright 2015-
|
2
|
+
# Copyright 2015-2017, Noah Kantrowitz
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -18,57 +18,35 @@ require 'spec_helper'
|
|
18
18
|
|
19
19
|
describe PoiseApplicationGit::Resource do
|
20
20
|
step_into(:application_git)
|
21
|
-
recipe do
|
22
|
-
application_git '/test' do
|
23
|
-
user 'root'
|
24
|
-
repository 'https://example.com/test.git'
|
25
|
-
revision 'd44ec06d0b2a87732e91c005ed2048c824fd63ed'
|
26
|
-
deploy_key 'secretkey'
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
21
|
before do
|
31
|
-
# Don't actually run the real thing
|
32
|
-
allow_any_instance_of(
|
33
|
-
allow_any_instance_of(PoiseApplicationGit::Provider).to receive(:include_recipe).with('git').and_return(nil)
|
34
|
-
# Unwrap notifying_block
|
35
|
-
allow_any_instance_of(PoiseApplicationGit::Provider).to receive(:notifying_block) {|&block| block.call }
|
22
|
+
# Don't actually run the real thing, this is awkward as hell but sigh.
|
23
|
+
allow_any_instance_of(PoiseGit::Resources::PoiseGit::Provider).to receive(:action_sync).and_return(nil)
|
36
24
|
end
|
37
25
|
|
38
|
-
|
39
|
-
it { is_expected.to render_file(File.expand_path('~root/.ssh/id_deploy_2089348824')).with_content('secretkey') }
|
40
|
-
it { is_expected.to render_file(File.expand_path('~root/.ssh/ssh_wrapper_2089348824')).with_content(%Q{#!/bin/sh\n/usr/bin/env ssh -o "StrictHostKeyChecking=no" -i "#{File.expand_path('~root/.ssh/id_deploy_2089348824')}" $@\n}) }
|
41
|
-
|
42
|
-
context 'with a local path to a deploy key' do
|
26
|
+
context 'with basic usage' do
|
43
27
|
recipe do
|
44
28
|
application_git '/test' do
|
45
|
-
user 'root'
|
46
29
|
repository 'https://example.com/test.git'
|
47
30
|
revision 'd44ec06d0b2a87732e91c005ed2048c824fd63ed'
|
48
|
-
deploy_key '
|
31
|
+
deploy_key 'secretkey'
|
49
32
|
end
|
50
33
|
end
|
51
34
|
|
52
|
-
it { is_expected.to sync_application_git('/test').with(repository: 'https://example.com/test.git', revision: 'd44ec06d0b2a87732e91c005ed2048c824fd63ed', deploy_key: '
|
53
|
-
|
54
|
-
|
55
|
-
end # /context with a local path to a deploy key
|
35
|
+
it { is_expected.to sync_application_git('/test').with(destination: '/test', repository: 'https://example.com/test.git', revision: 'd44ec06d0b2a87732e91c005ed2048c824fd63ed', deploy_key: 'secretkey') }
|
36
|
+
end # /context with basic usage
|
37
|
+
|
56
38
|
|
57
|
-
context 'with
|
39
|
+
context 'with a local path to a deploy key' do
|
58
40
|
recipe do
|
59
41
|
application_git '/test' do
|
60
|
-
user 'root'
|
61
42
|
repository 'https://example.com/test.git'
|
62
43
|
revision 'd44ec06d0b2a87732e91c005ed2048c824fd63ed'
|
63
|
-
deploy_key '
|
64
|
-
strict_ssh true
|
44
|
+
deploy_key '/etc/key'
|
65
45
|
end
|
66
46
|
end
|
67
47
|
|
68
|
-
it { is_expected.to sync_application_git('/test').with(repository: 'https://example.com/test.git', revision: 'd44ec06d0b2a87732e91c005ed2048c824fd63ed', deploy_key: '
|
69
|
-
|
70
|
-
it { expect(chef_run.application_git('/test').to_text).to include 'deploy_key "suppressed sensitive value"' }
|
71
|
-
end # /context with strict SSH
|
48
|
+
it { is_expected.to sync_application_git('/test').with(destination: '/test', repository: 'https://example.com/test.git', revision: 'd44ec06d0b2a87732e91c005ed2048c824fd63ed', deploy_key: '/etc/key') }
|
49
|
+
end # /context with a local path to a deploy key
|
72
50
|
|
73
51
|
context 'with an application path' do
|
74
52
|
recipe do
|
@@ -82,27 +60,14 @@ describe PoiseApplicationGit::Resource do
|
|
82
60
|
it { is_expected.to sync_application_git('https://example.com/test.git').with(destination: '/app', repository: 'https://example.com/test.git', revision: 'd44ec06d0b2a87732e91c005ed2048c824fd63ed') }
|
83
61
|
end # /context with an application path
|
84
62
|
|
85
|
-
context 'with a short name' do
|
86
|
-
before do
|
87
|
-
expect_any_instance_of(PoiseApplicationGit::Provider).to receive(:remote_resolve_reference) {|instance| instance.new_resource.revision }
|
88
|
-
end
|
89
|
-
recipe do
|
90
|
-
application '/app' do
|
91
|
-
application_git 'https://example.com/test.git'
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
it { is_expected.to sync_application_git('https://example.com/test.git').with(destination: '/app', repository: 'https://example.com/test.git', revision: 'HEAD') }
|
96
|
-
end # /context with a short name
|
97
63
|
|
98
64
|
context 'with an application owner' do
|
99
|
-
before do
|
100
|
-
expect_any_instance_of(PoiseApplicationGit::Provider).to receive(:remote_resolve_reference) {|instance| instance.new_resource.revision }
|
101
|
-
end
|
102
65
|
recipe do
|
103
66
|
application '/app' do
|
104
67
|
owner 'myuser'
|
105
|
-
application_git 'https://example.com/test.git'
|
68
|
+
application_git 'https://example.com/test.git' do
|
69
|
+
revision 'd44ec06d0b2a87732e91c005ed2048c824fd63ed'
|
70
|
+
end
|
106
71
|
end
|
107
72
|
end
|
108
73
|
|
@@ -110,31 +75,15 @@ describe PoiseApplicationGit::Resource do
|
|
110
75
|
end # /context with an application owner
|
111
76
|
|
112
77
|
context 'with an application group' do
|
113
|
-
before do
|
114
|
-
expect_any_instance_of(PoiseApplicationGit::Provider).to receive(:remote_resolve_reference) {|instance| instance.new_resource.revision }
|
115
|
-
end
|
116
78
|
recipe do
|
117
79
|
application '/app' do
|
118
80
|
group 'mygroup'
|
119
|
-
application_git 'https://example.com/test.git'
|
81
|
+
application_git 'https://example.com/test.git' do
|
82
|
+
revision 'd44ec06d0b2a87732e91c005ed2048c824fd63ed'
|
83
|
+
end
|
120
84
|
end
|
121
85
|
end
|
122
86
|
|
123
87
|
it { is_expected.to sync_application_git('https://example.com/test.git').with(group: 'mygroup') }
|
124
88
|
end # /context with an application group
|
125
|
-
|
126
|
-
context 'with a user that does not exist' do
|
127
|
-
recipe do
|
128
|
-
application_git '/test' do
|
129
|
-
action :nothing
|
130
|
-
user 'notauser'
|
131
|
-
repository 'https://example.com/test.git'
|
132
|
-
revision 'd44ec06d0b2a87732e91c005ed2048c824fd63ed'
|
133
|
-
deploy_key 'secretkey'
|
134
|
-
end
|
135
|
-
end
|
136
|
-
|
137
|
-
# Just make sure it doesn't crash on compile.
|
138
|
-
it { run_chef }
|
139
|
-
end # /context with a user that does not exist
|
140
89
|
end
|
data/test/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright 2015-
|
2
|
+
# Copyright 2015-2017, Noah Kantrowitz
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -16,3 +16,6 @@
|
|
16
16
|
|
17
17
|
require 'poise_boiler/spec_helper'
|
18
18
|
require 'poise_application_git'
|
19
|
+
require 'poise_git/cheftie'
|
20
|
+
require 'poise_application/cheftie'
|
21
|
+
require 'poise_application_git/cheftie'
|
metadata
CHANGED
@@ -1,15 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poise-application-git
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noah Kantrowitz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: chef
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '12.1'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '14'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '12.1'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '14'
|
13
33
|
- !ruby/object:Gem::Dependency
|
14
34
|
name: halite
|
15
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,19 +73,19 @@ dependencies:
|
|
53
73
|
- !ruby/object:Gem::Version
|
54
74
|
version: '5.0'
|
55
75
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
76
|
+
name: poise-git
|
57
77
|
requirement: !ruby/object:Gem::Requirement
|
58
78
|
requirements:
|
59
79
|
- - "~>"
|
60
80
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
62
|
-
type: :
|
81
|
+
version: '1.0'
|
82
|
+
type: :runtime
|
63
83
|
prerelease: false
|
64
84
|
version_requirements: !ruby/object:Gem::Requirement
|
65
85
|
requirements:
|
66
86
|
- - "~>"
|
67
87
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
88
|
+
version: '1.0'
|
69
89
|
- !ruby/object:Gem::Dependency
|
70
90
|
name: poise-boiler
|
71
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -91,7 +111,6 @@ files:
|
|
91
111
|
- ".kitchen.yml"
|
92
112
|
- ".travis.yml"
|
93
113
|
- ".yardopts"
|
94
|
-
- Berksfile
|
95
114
|
- CHANGELOG.md
|
96
115
|
- Gemfile
|
97
116
|
- LICENSE
|
@@ -102,20 +121,31 @@ files:
|
|
102
121
|
- lib/poise_application_git.rb
|
103
122
|
- lib/poise_application_git/cheftie.rb
|
104
123
|
- lib/poise_application_git/resource.rb
|
105
|
-
- lib/poise_application_git/safe_string.rb
|
106
124
|
- lib/poise_application_git/version.rb
|
107
125
|
- poise-application-git.gemspec
|
108
126
|
- test/cookbook/metadata.rb
|
109
127
|
- test/cookbook/recipes/default.rb
|
110
128
|
- test/docker/docker.ca
|
111
129
|
- test/docker/docker.pem
|
112
|
-
- test/gemfiles/chef-12.0.gemfile
|
113
130
|
- test/gemfiles/chef-12.1.gemfile
|
131
|
+
- test/gemfiles/chef-12.10.gemfile
|
132
|
+
- test/gemfiles/chef-12.11.gemfile
|
133
|
+
- test/gemfiles/chef-12.12.gemfile
|
134
|
+
- test/gemfiles/chef-12.13.gemfile
|
135
|
+
- test/gemfiles/chef-12.14.gemfile
|
136
|
+
- test/gemfiles/chef-12.15.gemfile
|
137
|
+
- test/gemfiles/chef-12.16.gemfile
|
138
|
+
- test/gemfiles/chef-12.17.gemfile
|
139
|
+
- test/gemfiles/chef-12.18.gemfile
|
140
|
+
- test/gemfiles/chef-12.19.gemfile
|
114
141
|
- test/gemfiles/chef-12.2.gemfile
|
115
142
|
- test/gemfiles/chef-12.3.gemfile
|
116
143
|
- test/gemfiles/chef-12.4.gemfile
|
117
144
|
- test/gemfiles/chef-12.5.gemfile
|
118
145
|
- test/gemfiles/chef-12.6.gemfile
|
146
|
+
- test/gemfiles/chef-12.7.gemfile
|
147
|
+
- test/gemfiles/chef-12.8.gemfile
|
148
|
+
- test/gemfiles/chef-12.9.gemfile
|
119
149
|
- test/gemfiles/chef-12.gemfile
|
120
150
|
- test/gemfiles/master.gemfile
|
121
151
|
- test/integration/default/serverspec/default_spec.rb
|
@@ -126,7 +156,6 @@ licenses:
|
|
126
156
|
- Apache 2.0
|
127
157
|
metadata:
|
128
158
|
halite_name: application_git
|
129
|
-
halite_dependencies: git
|
130
159
|
post_install_message:
|
131
160
|
rdoc_options: []
|
132
161
|
require_paths:
|
@@ -143,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
172
|
version: '0'
|
144
173
|
requirements: []
|
145
174
|
rubyforge_project:
|
146
|
-
rubygems_version: 2.
|
175
|
+
rubygems_version: 2.6.11
|
147
176
|
signing_key:
|
148
177
|
specification_version: 4
|
149
178
|
summary: A plugin for poise-application to deploy applications from git.
|
@@ -152,16 +181,27 @@ test_files:
|
|
152
181
|
- test/cookbook/recipes/default.rb
|
153
182
|
- test/docker/docker.ca
|
154
183
|
- test/docker/docker.pem
|
155
|
-
- test/gemfiles/chef-12.0.gemfile
|
156
184
|
- test/gemfiles/chef-12.1.gemfile
|
185
|
+
- test/gemfiles/chef-12.10.gemfile
|
186
|
+
- test/gemfiles/chef-12.11.gemfile
|
187
|
+
- test/gemfiles/chef-12.12.gemfile
|
188
|
+
- test/gemfiles/chef-12.13.gemfile
|
189
|
+
- test/gemfiles/chef-12.14.gemfile
|
190
|
+
- test/gemfiles/chef-12.15.gemfile
|
191
|
+
- test/gemfiles/chef-12.16.gemfile
|
192
|
+
- test/gemfiles/chef-12.17.gemfile
|
193
|
+
- test/gemfiles/chef-12.18.gemfile
|
194
|
+
- test/gemfiles/chef-12.19.gemfile
|
157
195
|
- test/gemfiles/chef-12.2.gemfile
|
158
196
|
- test/gemfiles/chef-12.3.gemfile
|
159
197
|
- test/gemfiles/chef-12.4.gemfile
|
160
198
|
- test/gemfiles/chef-12.5.gemfile
|
161
199
|
- test/gemfiles/chef-12.6.gemfile
|
200
|
+
- test/gemfiles/chef-12.7.gemfile
|
201
|
+
- test/gemfiles/chef-12.8.gemfile
|
202
|
+
- test/gemfiles/chef-12.9.gemfile
|
162
203
|
- test/gemfiles/chef-12.gemfile
|
163
204
|
- test/gemfiles/master.gemfile
|
164
205
|
- test/integration/default/serverspec/default_spec.rb
|
165
206
|
- test/spec/resource_spec.rb
|
166
207
|
- test/spec/spec_helper.rb
|
167
|
-
has_rdoc:
|