poise-application-python 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.kitchen.travis.yml +9 -0
- data/.kitchen.yml +10 -0
- data/.travis.yml +20 -0
- data/.yardopts +3 -0
- data/Berksfile +35 -0
- data/CHANGELOG.md +71 -0
- data/Gemfile +37 -0
- data/LICENSE +201 -0
- data/README.md +334 -0
- data/Rakefile +17 -0
- data/SUPPORTERS.md +81 -0
- data/chef/templates/celeryconfig.py.erb +5 -0
- data/chef/templates/settings.py.erb +13 -0
- data/lib/poise_application_python.rb +23 -0
- data/lib/poise_application_python/app_mixin.rb +67 -0
- data/lib/poise_application_python/cheftie.rb +17 -0
- data/lib/poise_application_python/error.rb +25 -0
- data/lib/poise_application_python/resources.rb +26 -0
- data/lib/poise_application_python/resources/celery_beat.rb +43 -0
- data/lib/poise_application_python/resources/celery_config.rb +109 -0
- data/lib/poise_application_python/resources/celery_worker.rb +77 -0
- data/lib/poise_application_python/resources/django.rb +355 -0
- data/lib/poise_application_python/resources/gunicorn.rb +127 -0
- data/lib/poise_application_python/resources/pip_requirements.rb +47 -0
- data/lib/poise_application_python/resources/python.rb +57 -0
- data/lib/poise_application_python/resources/python_execute.rb +89 -0
- data/lib/poise_application_python/resources/python_package.rb +62 -0
- data/lib/poise_application_python/resources/virtualenv.rb +75 -0
- data/lib/poise_application_python/service_mixin.rb +57 -0
- data/lib/poise_application_python/version.rb +19 -0
- data/poise-application-python.gemspec +45 -0
- data/test/cookbooks/application_python_test/attributes/default.rb +17 -0
- data/test/cookbooks/application_python_test/metadata.rb +20 -0
- data/test/cookbooks/application_python_test/recipes/default.rb +83 -0
- data/test/cookbooks/application_python_test/recipes/django.rb +32 -0
- data/test/cookbooks/application_python_test/recipes/flask.rb +25 -0
- data/test/gemfiles/chef-12.gemfile +19 -0
- data/test/gemfiles/master.gemfile +27 -0
- data/test/integration/default/serverspec/default_spec.rb +81 -0
- data/test/integration/default/serverspec/django_spec.rb +56 -0
- data/test/integration/default/serverspec/flask_spec.rb +39 -0
- data/test/spec/app_mixin_spec.rb +69 -0
- data/test/spec/resources/celery_config_spec.rb +58 -0
- data/test/spec/resources/django_spec.rb +303 -0
- data/test/spec/resources/gunicorn_spec.rb +96 -0
- data/test/spec/resources/python_execute_spec.rb +46 -0
- data/test/spec/resources/python_spec.rb +44 -0
- data/test/spec/resources/virtualenv_spec.rb +44 -0
- data/test/spec/spec_helper.rb +19 -0
- metadata +216 -0
@@ -0,0 +1,46 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2015, 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
|
+
require 'spec_helper'
|
18
|
+
|
19
|
+
describe PoiseApplicationPython::Resources::PythonExecute do
|
20
|
+
step_into(:application_python_execute)
|
21
|
+
recipe do
|
22
|
+
application '/srv/myapp' do
|
23
|
+
owner 'myuser'
|
24
|
+
group 'mygroup'
|
25
|
+
environment ENVKEY: 'ENVVALUE'
|
26
|
+
|
27
|
+
python('') { provider :dummy }
|
28
|
+
python_execute 'myapp.py'
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
it do
|
33
|
+
expect_any_instance_of(described_class::Provider).to receive(:shell_out!).with(
|
34
|
+
'/python myapp.py',
|
35
|
+
user: 'myuser',
|
36
|
+
group: 'mygroup',
|
37
|
+
cwd: '/srv/myapp',
|
38
|
+
timeout: 3600,
|
39
|
+
returns: 0,
|
40
|
+
environment: {'ENVKEY' => 'ENVVALUE'},
|
41
|
+
log_level: :info,
|
42
|
+
log_tag: 'application_python_execute[myapp.py]',
|
43
|
+
)
|
44
|
+
is_expected.to run_application_python_execute('myapp.py').with(user: 'myuser', group: 'mygroup', cwd: '/srv/myapp')
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2015, 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
|
+
require 'spec_helper'
|
18
|
+
|
19
|
+
describe PoiseApplicationPython::Resources::Python do
|
20
|
+
shared_examples 'application_python' do
|
21
|
+
it { is_expected.to install_application_python('ver') }
|
22
|
+
it { expect(chef_run.application('/test').app_state[:python]).to eq chef_run.application_python('ver') }
|
23
|
+
end # /shared_examples application_python
|
24
|
+
|
25
|
+
context 'with #python_runtime' do
|
26
|
+
recipe do
|
27
|
+
application '/test' do
|
28
|
+
python_runtime 'ver'
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
it_behaves_like 'application_python'
|
33
|
+
end # /context with #python_runtime
|
34
|
+
|
35
|
+
context 'with #python' do
|
36
|
+
recipe do
|
37
|
+
application '/test' do
|
38
|
+
python 'ver'
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
it_behaves_like 'application_python'
|
43
|
+
end # /context with #python
|
44
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2015, 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
|
+
require 'spec_helper'
|
18
|
+
|
19
|
+
describe PoiseApplicationPython::Resources::Virtualenv do
|
20
|
+
shared_examples 'application_virtualenv' do
|
21
|
+
it { is_expected.to create_application_virtualenv('/test').with(path: '/test/.virtualenv') }
|
22
|
+
it { expect(chef_run.application('/test').app_state[:python]).to eq chef_run.application_virtualenv('/test') }
|
23
|
+
end # /shared_examples application_virtualenv
|
24
|
+
|
25
|
+
context 'with #python_virtualenv' do
|
26
|
+
recipe do
|
27
|
+
application '/test' do
|
28
|
+
python_virtualenv
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
it_behaves_like 'application_virtualenv'
|
33
|
+
end # /context with #python_virtualenv
|
34
|
+
|
35
|
+
context 'with #virtualenv' do
|
36
|
+
recipe do
|
37
|
+
application '/test' do
|
38
|
+
virtualenv
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
it_behaves_like 'application_virtualenv'
|
43
|
+
end # /context with #virtualenv
|
44
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2015, 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
|
+
require 'poise_boiler/spec_helper'
|
18
|
+
require 'poise_application_python'
|
19
|
+
require 'poise_application/cheftie'
|
metadata
ADDED
@@ -0,0 +1,216 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: poise-application-python
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 4.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Noah Kantrowitz
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-10-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: halite
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: poise
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: poise-application
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: poise-python
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: poise-service
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: poise-boiler
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: poise-application-git
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.0'
|
111
|
+
description: A Chef cookbook for deploying Python application code.
|
112
|
+
email:
|
113
|
+
- noah@coderanger.net
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- ".gitignore"
|
119
|
+
- ".kitchen.travis.yml"
|
120
|
+
- ".kitchen.yml"
|
121
|
+
- ".travis.yml"
|
122
|
+
- ".yardopts"
|
123
|
+
- Berksfile
|
124
|
+
- CHANGELOG.md
|
125
|
+
- Gemfile
|
126
|
+
- LICENSE
|
127
|
+
- README.md
|
128
|
+
- Rakefile
|
129
|
+
- SUPPORTERS.md
|
130
|
+
- chef/templates/celeryconfig.py.erb
|
131
|
+
- chef/templates/settings.py.erb
|
132
|
+
- lib/poise_application_python.rb
|
133
|
+
- lib/poise_application_python/app_mixin.rb
|
134
|
+
- lib/poise_application_python/cheftie.rb
|
135
|
+
- lib/poise_application_python/error.rb
|
136
|
+
- lib/poise_application_python/resources.rb
|
137
|
+
- lib/poise_application_python/resources/celery_beat.rb
|
138
|
+
- lib/poise_application_python/resources/celery_config.rb
|
139
|
+
- lib/poise_application_python/resources/celery_worker.rb
|
140
|
+
- lib/poise_application_python/resources/django.rb
|
141
|
+
- lib/poise_application_python/resources/gunicorn.rb
|
142
|
+
- lib/poise_application_python/resources/pip_requirements.rb
|
143
|
+
- lib/poise_application_python/resources/python.rb
|
144
|
+
- lib/poise_application_python/resources/python_execute.rb
|
145
|
+
- lib/poise_application_python/resources/python_package.rb
|
146
|
+
- lib/poise_application_python/resources/virtualenv.rb
|
147
|
+
- lib/poise_application_python/service_mixin.rb
|
148
|
+
- lib/poise_application_python/version.rb
|
149
|
+
- poise-application-python.gemspec
|
150
|
+
- test/cookbooks/application_python_test/attributes/default.rb
|
151
|
+
- test/cookbooks/application_python_test/metadata.rb
|
152
|
+
- test/cookbooks/application_python_test/recipes/default.rb
|
153
|
+
- test/cookbooks/application_python_test/recipes/django.rb
|
154
|
+
- test/cookbooks/application_python_test/recipes/flask.rb
|
155
|
+
- test/docker/docker.ca
|
156
|
+
- test/docker/docker.pem
|
157
|
+
- test/gemfiles/chef-12.gemfile
|
158
|
+
- test/gemfiles/master.gemfile
|
159
|
+
- test/integration/default/serverspec/default_spec.rb
|
160
|
+
- test/integration/default/serverspec/django_spec.rb
|
161
|
+
- test/integration/default/serverspec/flask_spec.rb
|
162
|
+
- test/spec/app_mixin_spec.rb
|
163
|
+
- test/spec/resources/celery_config_spec.rb
|
164
|
+
- test/spec/resources/django_spec.rb
|
165
|
+
- test/spec/resources/gunicorn_spec.rb
|
166
|
+
- test/spec/resources/python_execute_spec.rb
|
167
|
+
- test/spec/resources/python_spec.rb
|
168
|
+
- test/spec/resources/virtualenv_spec.rb
|
169
|
+
- test/spec/spec_helper.rb
|
170
|
+
homepage: https://github.com/poise/application_python
|
171
|
+
licenses:
|
172
|
+
- Apache 2.0
|
173
|
+
metadata:
|
174
|
+
halite_name: application_python
|
175
|
+
post_install_message:
|
176
|
+
rdoc_options: []
|
177
|
+
require_paths:
|
178
|
+
- lib
|
179
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
180
|
+
requirements:
|
181
|
+
- - ">="
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
version: '0'
|
184
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
|
+
requirements:
|
186
|
+
- - ">="
|
187
|
+
- !ruby/object:Gem::Version
|
188
|
+
version: '0'
|
189
|
+
requirements: []
|
190
|
+
rubyforge_project:
|
191
|
+
rubygems_version: 2.4.8
|
192
|
+
signing_key:
|
193
|
+
specification_version: 4
|
194
|
+
summary: A Chef cookbook for deploying Python application code.
|
195
|
+
test_files:
|
196
|
+
- test/cookbooks/application_python_test/attributes/default.rb
|
197
|
+
- test/cookbooks/application_python_test/metadata.rb
|
198
|
+
- test/cookbooks/application_python_test/recipes/default.rb
|
199
|
+
- test/cookbooks/application_python_test/recipes/django.rb
|
200
|
+
- test/cookbooks/application_python_test/recipes/flask.rb
|
201
|
+
- test/docker/docker.ca
|
202
|
+
- test/docker/docker.pem
|
203
|
+
- test/gemfiles/chef-12.gemfile
|
204
|
+
- test/gemfiles/master.gemfile
|
205
|
+
- test/integration/default/serverspec/default_spec.rb
|
206
|
+
- test/integration/default/serverspec/django_spec.rb
|
207
|
+
- test/integration/default/serverspec/flask_spec.rb
|
208
|
+
- test/spec/app_mixin_spec.rb
|
209
|
+
- test/spec/resources/celery_config_spec.rb
|
210
|
+
- test/spec/resources/django_spec.rb
|
211
|
+
- test/spec/resources/gunicorn_spec.rb
|
212
|
+
- test/spec/resources/python_execute_spec.rb
|
213
|
+
- test/spec/resources/python_spec.rb
|
214
|
+
- test/spec/resources/virtualenv_spec.rb
|
215
|
+
- test/spec/spec_helper.rb
|
216
|
+
has_rdoc:
|