-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #550 from adamkingit/master
Add Bluemix deploy provider
- Loading branch information
Showing
5 changed files
with
105 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
Gemfile.lock | ||
.coverage | ||
coverage | ||
.dpl | ||
setuptools*.zip | ||
google_appengine_*.zip | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module DPL | ||
class Provider | ||
class BluemixCloudFoundry < CloudFoundry | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require 'spec_helper' | ||
require 'dpl/provider/bluemix_cloud_foundry' | ||
|
||
describe DPL::Provider::BluemixCloudFoundry 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 |