Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 61e9bcc

Browse files
committed
Merge pull request GannettDigital#12 from GannettDigital/GDAES-3302-pip
Gdaes 3302 pip
2 parents e07f898 + e5b126c commit 61e9bcc

File tree

14 files changed

+19118
-21555
lines changed

14 files changed

+19118
-21555
lines changed

.kitchen.ec2.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ driver:
1010
associate_public_ip: false
1111
interface: private
1212
user_data: <%= ENV['USER_DATA_PATH'] %>
13+
tags:
14+
OWNER: <%= ENV['AWS_OWNER_TAG'] %>
15+
Name: <%= ENV['AWS_NAME_TAG'] %>
1316

1417
provisioner:
1518
name: chef_zero
@@ -19,7 +22,7 @@ transport:
1922
ssh_key: ~/.ssh/<%= ENV['AWS_SSH_KEY'] %>.pem
2023

2124
platforms:
22-
- name: centos-6.6-python-integration-tests
25+
- name: centos-6.7-python-integration-tests
2326
driver:
2427
image_id: <%= ENV['AWS_AMI_ID'] %>
2528

@@ -41,6 +44,15 @@ suites:
4144
install_method: "package"
4245
setuptools_version: 18.0.1
4346
virtualenv_version: 13.1.0
47+
- name: custom-package
48+
run_list:
49+
- recipe[yum-gd]
50+
- recipe[python]
51+
attributes:
52+
python:
53+
install_method: "custom-package"
54+
setuptools_version: 18.0.1
55+
virtualenv_version: 13.1.0
4456
- name: source
4557
run_list:
4658
- recipe[yum-gd]
@@ -49,4 +61,4 @@ suites:
4961
python:
5062
install_method: "source"
5163
setuptools_version: 18.0.1
52-
virtualenv_version: 13.1.0
64+
virtualenv_version: 13.1.0

.kitchen.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ provisioner:
99
chef_zero_port: 9010
1010

1111
platforms:
12-
- name: centos-6.6
13-
driver_config:
14-
box: opscode-centos-6.6
15-
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_centos-6.6_provisionerless.box
12+
- name: gdp-centos-6.7
13+
driver:
14+
box: centos-67
15+
box_url: https://deploy.gmti.gbahn.net/Images/CentOS6/vagrant/centos67-cloud-1.0.0.box
1616

1717
suites:
1818
- name: default
@@ -32,6 +32,15 @@ suites:
3232
install_method: "package"
3333
setuptools_version: 18.0.1
3434
virtualenv_version: 13.1.0
35+
- name: custom-package
36+
run_list:
37+
- recipe[yum-gd]
38+
- recipe[python]
39+
attributes:
40+
python:
41+
install_method: "custom-package"
42+
setuptools_version: 18.0.1
43+
virtualenv_version: 13.1.0
3544
- name: source
3645
run_list:
3746
- recipe[yum-gd]
@@ -40,4 +49,4 @@ suites:
4049
python:
4150
install_method: "source"
4251
setuptools_version: 18.0.1
43-
virtualenv_version: 13.1.0
52+
virtualenv_version: 13.1.0

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ python Cookbook CHANGELOG
22
=========================
33
This file is used to list changes made in each version of the python cookbook.
44

5+
v1.6.0
6+
------
7+
- Jason Neves - updated cookbook to be able to pin pip version installed,
8+
added target "custom-package" to kitchen and tests for it
9+
510
v1.5.5
611
------
712
- Jason Neves - version bump for centos 7 python version

Rakefile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'rspec/core/rake_task'
22
require 'rubocop/rake_task'
33
require 'foodcritic'
4-
require 'kitchen'
4+
require 'kitchen/cli'
55

66
# Style tests. Rubocop and Foodcritic
77
namespace :style do
@@ -34,16 +34,17 @@ namespace :integration do
3434
end
3535
end
3636
task :ec2 do
37-
Kitchen.logger = Kitchen.default_file_logger
38-
@loader = Kitchen::Loader::YAML.new(project_config: './.kitchen.ec2.yml')
39-
config = Kitchen::Config.new(loader: @loader)
40-
config.instances.each do |instance|
41-
instance.test(:always)
42-
end
37+
ENV['KITCHEN_YAML'] = './.kitchen.ec2.yml'
38+
Kitchen::CLI.new([], concurrency: 5, destroy: 'always').test
39+
end
40+
task :ec2_singlethread do
41+
ENV['KITCHEN_YAML'] = './.kitchen.ec2.yml'
42+
Kitchen::CLI.new([], destroy: 'always').test
4343
end
4444
end
4545

4646
# Default
4747
task default: ['style', 'spec', 'integration:vagrant']
4848
task ec2: ['style', 'spec', 'integration:ec2']
49+
task ec2_singlethread: ['style', 'spec', 'integration:ec2_singlethread']
4950
task test: ['style', 'spec']

attributes/default.rb

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,25 @@
2121
default['python']['install_method'] = 'custom-package'
2222

2323
if node['python']['install_method'] == 'package'
24-
case platform
25-
when 'smartos'
26-
default['python']['prefix_dir'] = '/opt/local'
27-
else
28-
default['python']['prefix_dir'] = '/usr'
29-
end
24+
default['python']['prefix_dir'] = case platform
25+
when 'smartos'
26+
'/opt/local'
27+
else
28+
'/usr'
29+
end
3030
else
3131
default['python']['prefix_dir'] = '/usr/local'
3232
end
3333

3434
default['python']['binary'] = "#{node['python']['prefix_dir']}/bin/python"
3535

3636
if node['python']['install_method'] == 'custom-package'
37-
case platform
38-
when 'amazon'
39-
default['python']['custom_package_name'] = 'python27alt'
40-
else
41-
default['python']['custom_package_name'] = 'python27'
42-
end
37+
default['python']['custom_package_name'] = case platform
38+
when 'amazon'
39+
'python27alt'
40+
else
41+
'python27'
42+
end
4343
end
4444

4545
case node['python']['install_method']
@@ -48,20 +48,20 @@
4848
when 'amazon'
4949
default['python']['version'] = '2.7.9-1.amzn1.gd'
5050
when 'centos', 'redhat'
51-
if node['platform_version'].to_f >= 7
52-
default['python']['version'] = '2.7.9-1.el7.centos.gd'
53-
else
54-
default['python']['version'] = '2.7.9-1.el6.gd'
55-
end
51+
default['python']['version'] = if node['platform_version'].to_f >= 7
52+
'2.7.9-1.el7.centos.gd'
53+
else
54+
'2.7.9-1.el6.gd'
55+
end
5656
end
5757
when 'package'
5858
case platform
5959
when 'centos', 'redhat'
60-
if node['platform_version'].to_f >= 7
61-
default['python']['version'] = '2.7.5-18.el7_1.1'
62-
else
63-
default['python']['version'] = '2.6.6-64.el6'
64-
end
60+
default['python']['version'] = if node['platform_version'].to_f >= 7
61+
'2.7.5-18.el7_1.1'
62+
else
63+
'2.6.6-64.el6'
64+
end
6565
else
6666
default['python']['version'] = '2.6.6-64.el6'
6767
end
@@ -79,3 +79,4 @@
7979
default['python']['virtualenv_location'] = "#{node['python']['prefix_dir']}/bin/virtualenv"
8080
default['python']['setuptools_version'] = nil # defaults to latest
8181
default['python']['virtualenv_version'] = nil
82+
default['python']['pip']['version'] = '7.1.2'

0 commit comments

Comments
 (0)