bosh-deployer 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ pkg
data/.rspec ADDED
@@ -0,0 +1,4 @@
1
+ --colour
2
+ --drb
3
+ --tag ~driver:selenium_chrome
4
+ --profile
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ gem 'bosh_cli'
data/Gemfile.lock ADDED
@@ -0,0 +1,100 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ bosh-deployer (0.0.1)
5
+ redcard
6
+ thor (~> 0.18)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ aws-sdk (1.44.0)
12
+ json (~> 1.4)
13
+ nokogiri (>= 1.4.4)
14
+ blobstore_client (1.2707.0)
15
+ aws-sdk (= 1.44.0)
16
+ bosh_common (~> 1.2707.0)
17
+ fog (~> 1.14.0)
18
+ httpclient (= 2.4.0)
19
+ multi_json (~> 1.1)
20
+ ruby-atmos-pure (~> 1.0.5)
21
+ bosh-template (1.2707.0)
22
+ semi_semantic (~> 1.1.0)
23
+ bosh_cli (1.2707.0)
24
+ blobstore_client (~> 1.2707.0)
25
+ bosh-template (~> 1.2707.0)
26
+ bosh_common (~> 1.2707.0)
27
+ highline (~> 1.6.2)
28
+ httpclient (= 2.4.0)
29
+ json_pure (~> 1.7)
30
+ minitar (~> 0.5.4)
31
+ net-scp (~> 1.1.0)
32
+ net-ssh (>= 2.2.1)
33
+ net-ssh-gateway (~> 1.2.0)
34
+ netaddr (~> 1.5.0)
35
+ progressbar (~> 0.9.0)
36
+ terminal-table (~> 1.4.3)
37
+ bosh_common (1.2707.0)
38
+ semi_semantic (~> 1.1.0)
39
+ builder (3.2.2)
40
+ diff-lcs (1.2.5)
41
+ excon (0.25.3)
42
+ fog (1.14.0)
43
+ builder
44
+ excon (~> 0.25.0)
45
+ formatador (~> 0.2.0)
46
+ mime-types
47
+ multi_json (~> 1.0)
48
+ net-scp (~> 1.1)
49
+ net-ssh (>= 2.1.3)
50
+ nokogiri (~> 1.5)
51
+ ruby-hmac
52
+ formatador (0.2.5)
53
+ highline (1.6.21)
54
+ httpclient (2.4.0)
55
+ json (1.8.1)
56
+ json_pure (1.8.1)
57
+ log4r (1.1.10)
58
+ mime-types (2.3)
59
+ mini_portile (0.6.0)
60
+ minitar (0.5.4)
61
+ multi_json (1.10.1)
62
+ net-scp (1.1.2)
63
+ net-ssh (>= 2.6.5)
64
+ net-ssh (2.9.1)
65
+ net-ssh-gateway (1.2.0)
66
+ net-ssh (>= 2.6.5)
67
+ netaddr (1.5.0)
68
+ nokogiri (1.6.3.1)
69
+ mini_portile (= 0.6.0)
70
+ progressbar (0.9.2)
71
+ rake (10.3.2)
72
+ redcard (1.1.0)
73
+ rspec (3.0.0)
74
+ rspec-core (~> 3.0.0)
75
+ rspec-expectations (~> 3.0.0)
76
+ rspec-mocks (~> 3.0.0)
77
+ rspec-core (3.0.4)
78
+ rspec-support (~> 3.0.0)
79
+ rspec-expectations (3.0.4)
80
+ diff-lcs (>= 1.2.0, < 2.0)
81
+ rspec-support (~> 3.0.0)
82
+ rspec-mocks (3.0.4)
83
+ rspec-support (~> 3.0.0)
84
+ rspec-support (3.0.4)
85
+ ruby-atmos-pure (1.0.5)
86
+ log4r (>= 1.1.9)
87
+ ruby-hmac (>= 0.4.0)
88
+ ruby-hmac (0.4.0)
89
+ semi_semantic (1.1.0)
90
+ terminal-table (1.4.5)
91
+ thor (0.19.1)
92
+
93
+ PLATFORMS
94
+ ruby
95
+
96
+ DEPENDENCIES
97
+ bosh-deployer!
98
+ bosh_cli
99
+ rake
100
+ rspec
data/README.md ADDED
@@ -0,0 +1,4 @@
1
+ bosh-deployer
2
+ =============
3
+
4
+ [![Build Status](https://travis-ci.org/bonzofenix/bosh-deployer.svg?branch=master)](https://travis-ci.org/bonzofenix/bosh-deployer)
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/bosh-deployer ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ $:.push File.dirname(__FILE__) + '/../lib'
3
+
4
+ require "rubygems"
5
+
6
+ require "bosh-deployer"
7
+ require "bosh-deployer/thor_cli"
8
+
9
+ Bosh::Deployer::ThorCli.start
@@ -0,0 +1,32 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'bosh-deployer/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "bosh-deployer"
8
+ gem.version = Bosh::Deployer::VERSION
9
+ gem.authors = ["Alan Moran"]
10
+ gem.email = ["bonzofenix@gmail.com"]
11
+ gem.description = %q{ CLI plugin for bosh to perform different deploying tasks}
12
+ gem.summary = <<-EOS
13
+ bosh-deployer can:
14
+ - downloads and upload stemcells specifies on a manifest
15
+ pending:
16
+ - deploy Bosh
17
+ - deploy CF
18
+ EOS
19
+ gem.homepage = "https://github.com/bonzofenix/bosh-deployer"
20
+
21
+ gem.required_ruby_version = '>= 1.9'
22
+
23
+ gem.files = `git ls-files`.split($/)
24
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
25
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
26
+ gem.require_paths = ["lib"]
27
+
28
+ gem.add_dependency "thor", "~> 0.18"
29
+ gem.add_dependency "redcard"
30
+ gem.add_development_dependency "rake"
31
+ gem.add_development_dependency "rspec"
32
+ end
@@ -0,0 +1,23 @@
1
+ require "bosh-deployer"
2
+
3
+ module Bosh::Cli::Command
4
+ class Deployer < Base
5
+ usage "deployer"
6
+ desc "show deployer sub-commands"
7
+ def help
8
+ say("bosh deployer sub-commands:")
9
+ nl
10
+ cmds = Bosh::Cli::Config.commands.values.find_all {|c|
11
+ c.usage =~ /^deployer/
12
+ }
13
+ Bosh::Cli::Command::Help.list_commands(cmds)
14
+ end
15
+
16
+ usage "deployer provision stemcells"
17
+ desc "finds and uploads the required stemcell point out in your manifest to bosh"
18
+ def provision_stemcells
19
+ require "bosh-deployer/cli/commands/provision_stemcells"
20
+ Bosh::Deployer::Cli::Commands::ProvisionStemcells.new.perform
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,37 @@
1
+ require 'yaml'
2
+
3
+ module Bosh; module Deployer; module Cli; module Commands; end; end; end; end
4
+
5
+ class Bosh::Deployer::Cli::Commands::ProvisionStemcells
6
+ attr_reader :manifest_path
7
+
8
+ def perform(manifest_path =default_manifest_path )
9
+ @manifest_path = manifest_path
10
+ puts "Downloading #{stemcell.tar_filename} from bosh-jenkins-atifacts ..."
11
+ stemcell.download
12
+ puts 'uploading stemcell ...'
13
+ stemcell.upload
14
+ end
15
+
16
+ protected
17
+ def stemcell
18
+ Bosh::Deployer::Stemcell.new(stemcell_name, stemcell_version)
19
+ end
20
+
21
+ def stemcell_name
22
+ manifest['meta']['stemcell']['name']
23
+ end
24
+
25
+ def stemcell_version
26
+ manifest['meta']['stemcell']['version']
27
+ end
28
+
29
+ def manifest
30
+ ::YAML.load_file(manifest_path)
31
+ end
32
+
33
+ def default_manifest_path
34
+ `bosh deployment`.scan(/.*`(.*)'/).first.first
35
+ end
36
+
37
+ end
@@ -0,0 +1,52 @@
1
+ module Bosh; module Deployer; end ;end
2
+
3
+ class Bosh::Deployer::Stemcell
4
+ attr_reader :name, :version, :default_path
5
+ def initialize(name, version, default_path = '~/.deployer/stemcells')
6
+ @name = name
7
+ @version = version
8
+ @default_path = default_path
9
+ end
10
+
11
+ def download
12
+ system("wget --timeout=10 -q #{url} -P #{default_path}")
13
+ end
14
+ def upload
15
+ system("bosh upload stemcell #{default_path}/#{tar_filename}")
16
+ end
17
+
18
+ def tar_filename
19
+ if os != 'centos'
20
+ "bosh-stemcell-#{version}-#{cloud}-#{virtualization_type}-#{os}-#{os_version}-go_agent.tgz"
21
+ else
22
+ "bosh-stemcell-#{version}-#{cloud}-#{virtualization_type}-#{os}-go_agent.tgz"
23
+ end
24
+ end
25
+
26
+ private
27
+ def url
28
+ "https://s3.amazonaws.com/bosh-jenkins-artifacts/bosh-stemcell/#{cloud}/#{tar_filename}"
29
+ end
30
+
31
+ def cloud
32
+ name_attrs[1]
33
+ end
34
+
35
+ def virtualization_type
36
+ name_attrs[2]
37
+ end
38
+
39
+ def os
40
+ name_attrs[3]
41
+ end
42
+
43
+ def os_version
44
+ name_attrs[4]
45
+ end
46
+
47
+ def name_attrs
48
+ @name_attrs ||= name.split('-')
49
+ end
50
+ end
51
+
52
+
@@ -0,0 +1,14 @@
1
+ require "thor"
2
+ require "bosh-deployer"
3
+
4
+ module Bosh::Deployer
5
+ class ThorCli < Thor
6
+
7
+ desc "provision_stemcells", "Download and uploads stemcells indicated in a manifest to the current target bosh"
8
+ def provision_stemcells(manifest_path = nil)
9
+ require "bosh-deployer/cli/commands/provision_stemcells"
10
+ deploy_cmd = Bosh::Deployer::Cli::Commands::ProvisionStemcells.new
11
+ deploy_cmd.perform(manifest_path)
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,5 @@
1
+ module Bosh
2
+ module Deployer
3
+ VERSION = '0.0.1'
4
+ end
5
+ end
@@ -0,0 +1,15 @@
1
+ # Requires Ruby language 1.9 and MRI or Rubinius
2
+ require "redcard"
3
+ RedCard.verify :mri, :ruby, :rubinius, "1.9"
4
+
5
+ module Bosh
6
+ module Deployer
7
+ end
8
+ end
9
+
10
+ require "bosh-deployer/version"
11
+ require "bosh-deployer/stemcell"
12
+
13
+ # require "bosh-bootstrap/network"
14
+ # require "bosh-bootstrap/key_pair"
15
+ # require "bosh-bootstrap/microbosh"
@@ -0,0 +1,17 @@
1
+ require 'cli'
2
+ require 'bosh/cli/commands/deployer' # "bosh bootstrap COMMAND" commands added to bosh CLI
3
+ require 'bosh-deployer/cli/commands/provision_stemcells'
4
+
5
+ describe Bosh::Cli::Command::Deployer do
6
+ let(:cli) do
7
+ described_class.new(nil)
8
+ end
9
+ let(:cmd){ double(Bosh::Deployer::Cli::Commands::ProvisionStemcells) }
10
+
11
+ it 'runs upload stemcell command' do
12
+ allow(cmd).to receive(:perform)
13
+ expect(Bosh::Deployer::Cli::Commands::ProvisionStemcells)
14
+ .to receive(:new).and_return(cmd)
15
+ cli.provision_stemcells
16
+ end
17
+ end
@@ -0,0 +1,56 @@
1
+ require "bosh-deployer/cli/commands/provision_stemcells"
2
+ require "bosh-deployer/stemcell"
3
+
4
+ describe Bosh::Deployer::Cli::Commands::ProvisionStemcells do
5
+ let(:cmd) { described_class.new }
6
+ let(:stemcell) { double.as_null_object }
7
+
8
+ before do
9
+ allow(Bosh::Deployer::Stemcell).to receive(:new)
10
+ .with('bosh-openstack-kvm-ubuntu-lucid-go_agent', 'latest')
11
+ .and_return(stemcell)
12
+ end
13
+
14
+ describe '#perform' do
15
+ let(:perform_provision_stemcells){ cmd.perform(manifest_path) }
16
+ let(:manifest_path){ 'spec/fixtures/manifests/cf.yml' }
17
+
18
+ describe 'when filename is provided' do
19
+ # meta:
20
+ # stemcell:
21
+ # name: bosh-openstack-kvm-ubuntu-lucid-go_agent
22
+ # version: latest
23
+
24
+ it 'download the stemcell' do
25
+ expect(stemcell).to receive(:download)
26
+ perform_provision_stemcells
27
+ end
28
+
29
+ it 'should upload stemcell to targeted bosh' do
30
+ expect(stemcell).to receive(:upload)
31
+ perform_provision_stemcells
32
+ end
33
+ end
34
+
35
+
36
+ describe 'when when filename is not provided' do
37
+ let(:perform_provision_stemcells){ cmd.perform }
38
+ before do
39
+ allow(cmd).to receive(:`)
40
+ .with('bosh deployment')
41
+ .and_return("Current deployment is `#{manifest_path}'\n")
42
+ end
43
+
44
+ describe 'when deployment is target ' do
45
+ it 'should use the target deployment manifest' do
46
+ perform_provision_stemcells
47
+ expect(cmd.manifest_path)
48
+ .to eq('spec/fixtures/manifests/cf.yml')
49
+ end
50
+ end
51
+
52
+ it 'should raise error with missing arguments' do
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,267 @@
1
+ meta:
2
+ bosh-network:
3
+ cidr:
4
+ openstack: null
5
+ floating_static_ips:
6
+ stemcell:
7
+ name: bosh-openstack-kvm-ubuntu-lucid-go_agent
8
+ version: latest
9
+ environment: cf
10
+ director_uuid: DELETE_ME
11
+ jobs:
12
+ ha_proxy_z1:
13
+ properties:
14
+ ha_proxy:
15
+ ssl_pem: '-----BEGIN PRIVATE KEY-----
16
+
17
+ MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC0qVqvF3LSEuPx
18
+
19
+ pm8Qr3nemnGlkZRbyiBcN3gzOQzfbZWU9BesKOgrGVldkKNVfKfcEMa8PiGFodp3
20
+
21
+ O451aX/rOvyAjYpq++gfRFbVJSuCvm8qTifc5R3mLe/OLdlr7J9J8PoCf4tw4Qs+
22
+
23
+ ND/9eaiCBgjzoMX1bJlKcYOo7VVnmRe7dhY1z8Kn7k4jHf/noFYXwI981NGDxyMz
24
+
25
+ MjuepjEt6zLDl2YKTmEGN1ibpMOxeJbmbkSwevkxDCUl2Ys++WemCqjLPsafxlr1
26
+
27
+ x+HzT9jyxWZsJAcNmcB6VMKLdYQPuB+fI6ckhCgzFp1skC2B5YAc7uUSVTs2HoIX
28
+
29
+ gl0FMyZJAgMBAAECggEBAJ9MMRzwZRsc8wbxxT8GK0SAFDN0sUdaa7xEYOVxqYsc
30
+
31
+ +mcz7+eqzkSqfmUFEzBe0Tg3RrVXZ4GIXLUDu7KFyvhks566r1F0O5HOVW5t7vbC
32
+
33
+ 6gx4i6e4EuwSlz/Kp8sFAtNU+23WfuKSXLKFqeLcMhwsLBp+Ke8kyemdPAVo+AR2
34
+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Lesy
96
+
97
+ w5dmCk5hBjdYm6TDsXiW5m5EsHr5MQwlJdmLPvlnpgqoyz7Gn8Za9cfh80/Y8sVm
98
+
99
+ bCQHDZnAelTCi3WED7gfnyOnJIQoMxadbJAtgeWAHO7lElU7Nh6CF4JdBTMmSQID
100
+
101
+ AQABo1AwTjAdBgNVHQ4EFgQUrxXnkZVYtbJSb1Xlsr051C6+KXowHwYDVR0jBBgw
102
+
103
+ FoAUrxXnkZVYtbJSb1Xlsr051C6+KXowDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0B
104
+
105
+ AQUFAAOCAQEAAKEcm18EsYuTWZwEzR7eLY/oWHaSFjmgZRUWozyepEdwoG1uVUyl
106
+
107
+ 0JKjy/0NfQbavcf6/PC/gbzx7D7/h11r6RwoagJsjie43t7bbIPvWpsT9GMn0C3l
108
+
109
+ C8516VwEl3XZ9NNcMWJ2MWByZyIHc2NrnaKLyhSQwovFn4Xam+uQ+RemIxZ7M3/X
110
+
111
+ 2yO5psb7UbhPPMXqGKiIGAKtCDUL6lYSiMILojVVmusjFechgPpHsj4FuVtthiSF
112
+
113
+ UWeNgWURGJ/dsZlPS6kvIldJysHAlcslwVuViIjqRc8TstxjUJYQ4LsLCbxwVUYl
114
+
115
+ HsC3XHyf7oHqw27el8ueOO/xGlz77FZdZw==
116
+
117
+ -----END CERTIFICATE-----'
118
+ instances: 1
119
+ networks:
120
+ cf1:
121
+ default: [ 'dns', 'gateway']
122
+ etcd_z1:
123
+ instances: 1
124
+ login_z2:
125
+ instances: 0
126
+
127
+ networks:
128
+ floating:
129
+ type: vip
130
+ cloud_properties:
131
+ net_id:
132
+ cf1: {}
133
+ cf-dynamic:
134
+ cloud_properties:
135
+ net_id:
136
+ security_groups:
137
+ - cf-public
138
+ - cf-private
139
+ - ssh
140
+ range:
141
+ type: dynamic
142
+ cf2:
143
+ type: manual
144
+ subnets:
145
+ - name: default_unused
146
+ range: 10.0.0.0/23
147
+ gateway: 10.0.0.1
148
+ reserved: []
149
+ static:
150
+ - 10.0.0.2 - 10.0.0.250
151
+ cloud_properties:
152
+ net_id: MICROBOSH_SUBNET_ID
153
+ security_groups:
154
+ - cf-public
155
+ - cf-private
156
+ - ssh
157
+ properties:
158
+ login:
159
+ protocol: http
160
+ ssl:
161
+ skip_cert_verify: true
162
+ domain: a_domain.xip.io
163
+ loggregator_endpoint:
164
+ shared_secret: 1p@ss4cf
165
+ cc:
166
+ bulk_api_password: 1p@ss4cf
167
+ db_encryption_key: 1p@ss4cf
168
+ staging_upload_password: upload-password
169
+ staging_upload_user: upload-user
170
+ databases:
171
+ roles:
172
+ - name: ccadmin
173
+ password: ccadmin
174
+ tag: admin
175
+ - name: uaaadmin
176
+ password: uaaadmin
177
+ tag: admin
178
+ ccdb:
179
+ roles:
180
+ - name: ccadmin
181
+ password: ccadmin
182
+ uaadb:
183
+ roles:
184
+ - name: uaaadmin
185
+ password: uaaadmin
186
+ uaa:
187
+ admin:
188
+ client_secret: 1p@ss4cf
189
+ batch:
190
+ password: 1p@ss4cf
191
+ username: batch
192
+ cc:
193
+ client_secret: 1p@ss4cf
194
+ clients:
195
+ app-direct:
196
+ secret: 1p@ss4cf
197
+ developer_console:
198
+ secret: 1p@ss4cf
199
+ login:
200
+ secret: 1p@ss4cf
201
+ servicesmgmt:
202
+ secret: 1p@ss4cf
203
+ space-mail:
204
+ secret: 1p@ss4cf
205
+ support-services:
206
+ secret: 1p@ss4cf
207
+ jwt:
208
+ signing_key: '-----BEGIN RSA PRIVATE KEY-----
209
+
210
+ MIICXAIBAAKBgQDHFr+KICms+tuT1OXJwhCUmR2dKVy7psa8xzElSyzqx7oJyfJ1
211
+
212
+ JZyOzToj9T5SfTIq396agbHJWVfYphNahvZ/7uMXqHxf+ZH9BL1gk9Y6kCnbM5R6
213
+
214
+ 0gfwjyW1/dQPjOzn9N394zd2FJoFHwdq9Qs0wBugspULZVNRxq7veq/fzwIDAQAB
215
+
216
+ AoGBAJ8dRTQFhIllbHx4GLbpTQsWXJ6w4hZvskJKCLM/o8R4n+0W45pQ1xEiYKdA
217
+
218
+ Z/DRcnjltylRImBD8XuLL8iYOQSZXNMb1h3g5/UGbUXLmCgQLOUUlnYt34QOQm+0
219
+
220
+ KvUqfMSFBbKMsYBAoQmNdTHBaz3dZa8ON9hh/f5TT8u0OWNRAkEA5opzsIXv+52J
221
+
222
+ duc1VGyX3SwlxiE2dStW8wZqGiuLH142n6MKnkLU4ctNLiclw6BZePXFZYIK+AkE
223
+
224
+ xQ+k16je5QJBAN0TIKMPWIbbHVr5rkdUqOyezlFFWYOwnMmw/BKa1d3zp54VP/P8
225
+
226
+ +5aQ2d4sMoKEOfdWH7UqMe3FszfYFvSu5KMCQFMYeFaaEEP7Jn8rGzfQ5HQd44ek
227
+
228
+ lQJqmq6CE2BXbY/i34FuvPcKU70HEEygY6Y9d8J3o6zQ0K9SYNu+pcXt4lkCQA3h
229
+
230
+ jJQQe5uEGJTExqed7jllQ0khFJzLMx0K6tj0NeeIzAaGCQz13oo2sCdeGRHO4aDh
231
+
232
+ HH6Qlq/6UOV5wP8+GAcCQFgRCcB+hrje8hfEEefHcFpyKH+5g1Eu1k0mLrxK2zd+
233
+
234
+ 4SlotYRHgPCEubokb2S1zfZDWIXW3HmggnGgM949TlY=
235
+
236
+ -----END RSA PRIVATE KEY-----
237
+
238
+ '
239
+ verification_key: '-----BEGIN PUBLIC KEY-----
240
+
241
+ MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDHFr+KICms+tuT1OXJwhCUmR2d
242
+
243
+ KVy7psa8xzElSyzqx7oJyfJ1JZyOzToj9T5SfTIq396agbHJWVfYphNahvZ/7uMX
244
+
245
+ qHxf+ZH9BL1gk9Y6kCnbM5R60gfwjyW1/dQPjOzn9N394zd2FJoFHwdq9Qs0wBug
246
+
247
+ spULZVNRxq7veq/fzwIDAQAB
248
+
249
+ -----END PUBLIC KEY-----
250
+
251
+ '
252
+ scim:
253
+ userids_enabled: false
254
+ users:
255
+ - admin|admin|scim.write,scim.read,openid,cloud_controller.admin,uaa.admin,password.write
256
+ - services|1p@ss4cf|scim.write,scim.read,openid,cloud_controller.admin
257
+ nats:
258
+ password: nats
259
+ user: nats
260
+ dea_next:
261
+ disk_mb: 10000
262
+ memory_mb: 1024
263
+ router:
264
+ status:
265
+ password: router
266
+ user: router
267
+
@@ -0,0 +1,55 @@
1
+ require "bosh-deployer/stemcell"
2
+
3
+ describe Bosh::Deployer::Stemcell do
4
+ let(:stemcell){described_class.new(name, version) }
5
+
6
+ [{
7
+ name: 'bosh-openstack-kvm-ubuntu-lucid',
8
+ version: 'latest',
9
+ expected_url: 'https://s3.amazonaws.com/bosh-jenkins-artifacts/bosh-stemcell/openstack/bosh-stemcell-latest-openstack-kvm-ubuntu-lucid-go_agent.tgz',
10
+ expected_tar: 'bosh-stemcell-latest-openstack-kvm-ubuntu-lucid-go_agent.tgz'
11
+ },
12
+ {
13
+ name: 'bosh-openstack-kvm-ubuntu-lucid-go_agent',
14
+ version: 'latest',
15
+ expected_url: 'https://s3.amazonaws.com/bosh-jenkins-artifacts/bosh-stemcell/openstack/bosh-stemcell-latest-openstack-kvm-ubuntu-lucid-go_agent.tgz',
16
+ expected_tar: 'bosh-stemcell-latest-openstack-kvm-ubuntu-lucid-go_agent.tgz'
17
+ },
18
+ {
19
+ name: 'bosh-aws-xen-centos-go_agent',
20
+ version: 'latest',
21
+ expected_url: 'https://s3.amazonaws.com/bosh-jenkins-artifacts/bosh-stemcell/aws/bosh-stemcell-latest-aws-xen-centos-go_agent.tgz',
22
+ expected_tar: 'bosh-stemcell-latest-aws-xen-centos-go_agent.tgz'
23
+ },
24
+ {
25
+ name: 'bosh-openstack-kvm-ubuntu-trusty-go_agent',
26
+ version: 'latest',
27
+ expected_url: 'https://s3.amazonaws.com/bosh-jenkins-artifacts/bosh-stemcell/openstack/bosh-stemcell-latest-openstack-kvm-ubuntu-trusty-go_agent.tgz',
28
+ expected_tar: 'bosh-stemcell-latest-openstack-kvm-ubuntu-trusty-go_agent.tgz'
29
+ }].each do |s|
30
+ describe "for #{s[:name]} with #{s[:version]} version" do
31
+ let(:version) { s[:version] }
32
+ let(:name) { s[:name] }
33
+
34
+ describe '#download' do
35
+ let(:expected_url) { s[:expected_url] }
36
+
37
+ it 'should use the correct url' do
38
+ expect(stemcell).to receive(:system)
39
+ .with("wget --timeout=10 -q #{expected_url} -P ~/.deployer/stemcells")
40
+ stemcell.download
41
+ end
42
+ end
43
+
44
+ describe '#upload' do
45
+ let(:expected_tar) { s[:expected_tar] }
46
+
47
+ it 'should upload the correct tar' do
48
+ expect(stemcell).to receive(:system)
49
+ .with("bosh upload stemcell ~/.deployer/stemcells/#{expected_tar}")
50
+ stemcell.upload
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
metadata ADDED
@@ -0,0 +1,134 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bosh-deployer
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Alan Moran
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-09-07 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: thor
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '0.18'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '0.18'
30
+ - !ruby/object:Gem::Dependency
31
+ name: redcard
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rake
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: rspec
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ description: ! ' CLI plugin for bosh to perform different deploying tasks'
79
+ email:
80
+ - bonzofenix@gmail.com
81
+ executables:
82
+ - bosh-deployer
83
+ extensions: []
84
+ extra_rdoc_files: []
85
+ files:
86
+ - .gitignore
87
+ - .rspec
88
+ - .travis.yml
89
+ - Gemfile
90
+ - Gemfile.lock
91
+ - README.md
92
+ - Rakefile
93
+ - bin/bosh-deployer
94
+ - bosh-deployer.gemspec
95
+ - lib/bosh-deployer.rb
96
+ - lib/bosh-deployer/cli/commands/provision_stemcells.rb
97
+ - lib/bosh-deployer/stemcell.rb
98
+ - lib/bosh-deployer/thor_cli.rb
99
+ - lib/bosh-deployer/version.rb
100
+ - lib/bosh/cli/commands/deployer.rb
101
+ - spec/cli/deployer_spec.rb
102
+ - spec/commands/provision_stemcells_spec.rb
103
+ - spec/fixtures/manifests/cf.yml
104
+ - spec/stemcell_spec.rb
105
+ homepage: https://github.com/bonzofenix/bosh-deployer
106
+ licenses: []
107
+ post_install_message:
108
+ rdoc_options: []
109
+ require_paths:
110
+ - lib
111
+ required_ruby_version: !ruby/object:Gem::Requirement
112
+ none: false
113
+ requirements:
114
+ - - ! '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '1.9'
117
+ required_rubygems_version: !ruby/object:Gem::Requirement
118
+ none: false
119
+ requirements:
120
+ - - ! '>='
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ requirements: []
124
+ rubyforge_project:
125
+ rubygems_version: 1.8.23.2
126
+ signing_key:
127
+ specification_version: 3
128
+ summary: ! 'bosh-deployer can: - downloads and upload stemcells specifies on a manifest
129
+ pending: - deploy Bosh - deploy CF'
130
+ test_files:
131
+ - spec/cli/deployer_spec.rb
132
+ - spec/commands/provision_stemcells_spec.rb
133
+ - spec/fixtures/manifests/cf.yml
134
+ - spec/stemcell_spec.rb