Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bluemix deploy provider #550

Merged
merged 22 commits into from
Jan 23, 2017
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Gemfile.lock
.coverage
coverage
.dpl
setuptools*.zip
google_appengine_*.zip
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Dpl supports the following providers:
* [Azure Web Apps](#azure-web-apps)
* [Bintray](#bintray)
* [BitBalloon](#bitballoon)
* [Bluemix Cloud Foundry](#bluemix-cloud-foundry)
* [Boxfuse](#boxfuse)
* [Catalyze](#catalyze)
* [Chef Supermarket](#chef-supermarket)
Expand Down Expand Up @@ -909,3 +910,19 @@ In order to use this provider, please make sure you have the [App Engine Admin A
#### Example:
dpl --provider=surge --project=<project-path> --domain=<domain-name>

### Bluemix Cloud Foundry:

#### Options:

* **username**: Bluemix username.
* **password**: Bluemix password.
* **organization**: Bluemix target organization.
* **space**: Bluemix target space
* **region**: Bluemix region [ng, eu-gb, au-syd]. Optional, default US region (ng).
* **api**: Bluemix api URL. Optional for Bluemix dedicated. Explicit **api** setting precedence over **region** setting.
* **manifest**: Path to manifest file. Optional.
* **skip_ssl_validation**: Skip ssl validation. Optional.

#### Examples:

dpl --provider=bluemixcf --username=<username> --password=<password> --organization=<organization> --region=<region> --space=<space> --skip-ssl-validation
2 changes: 1 addition & 1 deletion dpl.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rspec', '~> 3.0.0'
s.add_development_dependency 'rspec-its'
s.add_development_dependency 'rake'
s.add_development_dependency 'json', '1.8.1'
s.add_development_dependency 'json', '1.8.2'

This comment was marked as spam.

This comment was marked as spam.

s.add_development_dependency 'tins', '~> 1.6.0', '>= 1.6.0'
s.add_development_dependency 'coveralls'

Expand Down
1 change: 1 addition & 0 deletions lib/dpl/provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Provider
autoload :AzureWebApps, 'dpl/provider/azure_webapps'
autoload :Bintray, 'dpl/provider/bintray'
autoload :BitBalloon, 'dpl/provider/bitballoon'
autoload :BluemixCF, 'dpl/provider/bluemix_cloudfoundry'
autoload :Boxfuse, 'dpl/provider/boxfuse'
autoload :Catalyze, 'dpl/provider/catalyze'
autoload :ChefSupermarket, 'dpl/provider/chef_supermarket'
Expand Down
22 changes: 22 additions & 0 deletions lib/dpl/provider/bluemix_cloudfoundry.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module DPL
class Provider
class BluemixCF < CloudFoundry

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.


REGIONS = Hash.new {"api.ng.bluemix.net"}.update(
"eu-gb" => "api.eu-gb.bluemix.net",
"au-syd" => "api.au-syd.bluemix.net"
)

def set_api
region = options[:region] || "ng"
options[:api] = options[:api] || REGIONS[region]
end

def check_auth
set_api
super
end

end
end
end
23 changes: 23 additions & 0 deletions spec/provider/bluemix_cloudfoundry_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require 'spec_helper'
require 'dpl/provider/bluemix_cloudfoundry'

describe DPL::Provider::BluemixCF do
subject :provider do
described_class.new(DummyContext.new, region: 'eu-gb', username: 'Moonpie',
password: 'myexceptionallyaveragepassword',
organization: 'myotherorg',
space: 'inner',
manifest: 'worker-manifest.yml',
skip_ssl_validation: true)
end

describe "#check_auth" do
example do
expect(provider.context).to receive(:shell).with('wget \'https://cli.run.pivotal.io/stable?release=linux64-binary&source=github\' -qO cf-linux-amd64.tgz && tar -zxvf cf-linux-amd64.tgz && rm cf-linux-amd64.tgz')
expect(provider.context).to receive(:shell).with('./cf api api.eu-gb.bluemix.net --skip-ssl-validation')
expect(provider.context).to receive(:shell).with('./cf login -u Moonpie -p myexceptionallyaveragepassword -o myotherorg -s inner')
provider.check_auth
end
end

end