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

convox: added manifest parameter #1253

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,7 @@ Options:
--generation NUM type: integer, default: 2
--prepare CMDS Run commands with convox cli available just before deployment (type: array
(string, can be given multiple times))
--manifest STR Manifest file to be used during deployment (type: string, default: convox.yml)

Common Options:

Expand Down
5 changes: 3 additions & 2 deletions lib/dpl/providers/convox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ class Convox < Provider
opt '--description STR'
opt '--generation NUM', type: :int, default: '2'
opt '--prepare CMDS', 'Run commands with convox cli available just before deployment', type: :array
opt '--manifest STR', 'Manifest file to be used during deployment', default: 'convox.yml'

# if app and rack are exported to the env, do they need to be passed to these commands?
cmds login: 'convox version --rack %{rack}',
validate: 'convox apps info --rack %{rack} --app %{app}',
create: 'convox apps create %{app} --generation %{generation} --rack %{rack} --wait',
update: 'convox update',
set_env: 'convox env set %{env} --rack %{rack} --app %{app} --replace',
build: 'convox build --rack %{rack} --app %{app} --id --description %{escaped_description}',
deploy: 'convox deploy --rack %{rack} --app %{app} --wait --id --description %{escaped_description}'
build: 'convox build --rack %{rack} --app %{app} --id --manifest %{manifest} --description %{escaped_description}',
deploy: 'convox deploy --rack %{rack} --app %{app} --wait --id --manifest %{manifest} --description %{escaped_description}'

msgs create: 'Application %{app} does not exist on rack %{rack}. Creating it ...',
missing: 'Application %{app} does not exist on rack %{rack}.',
Expand Down
11 changes: 8 additions & 3 deletions spec/dpl/providers/convox_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
describe Dpl::Providers::Convox do
let(:args) { |e| %w(--app app --rack rack --password pass) + args_from_description(e) }
let(:exists) { true }
let(:manifest) { 'convox.yml' }

let(:desc) do
Shellwords.escape JSON.dump(
Expand Down Expand Up @@ -40,7 +41,7 @@
it { should have_run '[info] $ convox apps info --rack rack --app app' }
it { should have_run 'convox apps info --rack rack --app app' }
it { should have_run '[info] Building and promoting application ...' }
it { should have_run "convox deploy --rack rack --app app --wait --id --description #{desc}" }
it { should have_run "convox deploy --rack rack --app app --wait --id --manifest #{manifest} --description #{desc}" }
it { should have_run_in_order }
end

Expand All @@ -62,7 +63,7 @@
end

describe 'given --no-promote' do
it { should have_run "convox build --rack rack --app app --id --description #{desc}" }
it { should have_run "convox build --rack rack --app app --id --manifest #{manifest} --description #{desc}" }
it { should_not have_run /convox deploy/ }
end

Expand All @@ -79,7 +80,7 @@
end

describe 'given --description other' do
it { should have_run 'convox deploy --rack rack --app app --wait --id --description other' }
it { should have_run "convox deploy --rack rack --app app --wait --id --manifest #{manifest} --description other" }
end

describe 'given --env ONE=$one --env TWO=two' do
Expand Down Expand Up @@ -108,6 +109,10 @@
it { expect { subject.run }.to raise_error 'The given env_file does not exist.' }
end

describe 'given --manifest custom-convox.yml' do
it { should have_run "convox deploy --rack rack --app app --wait --id --manifest custom-convox.yml --description #{desc}" }
end

describe 'with credentials in env vars', run: false do
let(:args) { |e| %w(--app app --rack rack) }

Expand Down