-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pulling in andy-dufour's changes from the byop-sqitch-provider branch
- Loading branch information
Marc Paradise
committed
Jul 23, 2015
1 parent
b3c3cb6
commit 9e9c6db
Showing
5 changed files
with
89 additions
and
82 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
28 changes: 28 additions & 0 deletions
28
omnibus/files/private-chef-cookbooks/private-chef/providers/pg_sqitch.rb
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,28 @@ | ||
|
||
def whyrun_supported? | ||
true | ||
end | ||
|
||
use_inline_resources | ||
|
||
action :deploy do | ||
target = new_resource.target_version ? "--to-target #{new_resource.target_version}" : "" | ||
execute "sqitch_deploy_#{new_resource.name}" do | ||
command <<-EOM.gsub(/\s+/," ").strip! | ||
sqitch --engine pg | ||
--db-host #{new_resource.hostname} | ||
--db-port #{new_resource.port} | ||
--db-user #{new_resource.username} | ||
--db-name #{new_resource.database} | ||
--top-dir #{new_resource.name} | ||
deploy #{target} --verify | ||
EOM | ||
environment "PERL5LIB" => "", | ||
"PGPASSWORD" => new_resource.password | ||
# Sqitch Return Codes | ||
# 0 - when changes are applied | ||
# 1 - when everything is ok but no changes were made | ||
# 2(+?) - when an error occurs. | ||
returns [0,1] | ||
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
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
10 changes: 10 additions & 0 deletions
10
omnibus/files/private-chef-cookbooks/private-chef/resources/pg_sqitch.rb
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,10 @@ | ||
actions :deploy | ||
default_action :deploy | ||
|
||
attribute :name, kind_of: String, required: true, name_attribute: true | ||
attribute :database, kind_of: String, required: true | ||
attribute :username, kind_of: String | ||
attribute :password, kind_of: String, required: false, default: "" | ||
attribute :target_version, kind_of: String | ||
attribute :hostname, kind_of: String, required: true | ||
attribute :port, kind_of: Integer, required: true |