Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
renamed s3/file input to s3/file_dump in the import_dump_from_s3 recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Pop committed Sep 17, 2010
1 parent 76ffa0c commit 374e2e7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
28 changes: 14 additions & 14 deletions cookbooks/db_sqlserver/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@
],
"required": "required"
},
"s3/file_dump": {
"calculated": false,
"type": "string",
"choice": [

],
"description": "Sql dump file to be retrieved from the s3 bucket. Ex: production-dump.sql or production-dump.sql.zip",
"display_name": "Sql dump file",
"recipes": [
"db_sqlserver::default",
"db_sqlserver::import_dump_from_s3"
],
"required": "required"
},
"db_sqlserver/backup/existing_backup_file_name_pattern": {
"default": "{0}_*.bak",
"calculated": false,
Expand Down Expand Up @@ -112,20 +126,6 @@
],
"required": "required"
},
"s3/file": {
"calculated": false,
"type": "string",
"choice": [

],
"description": "Sql dump file to be retrieved from the s3 bucket. Ex: production-dump.sql or production-dump.sql.zip",
"display_name": "Sql dump file",
"recipes": [
"db_sqlserver::default",
"db_sqlserver::import_dump_from_s3"
],
"required": "required"
},
"db_sqlserver/restore/force_restore": {
"default": "false",
"calculated": false,
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/db_sqlserver/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
:choice => ['true', 'false'],
:default => "false"

attribute "s3/file",
attribute "s3/file_dump",
:display_name => "Sql dump file",
:description => "Sql dump file to be retrieved from the s3 bucket. Ex: production-dump.sql or production-dump.sql.zip",
:recipes => ["db_sqlserver::default", "db_sqlserver::import_dump_from_s3"],
Expand Down
10 changes: 5 additions & 5 deletions cookbooks/db_sqlserver/recipes/import_dump_from_s3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@
access_key_id @node[:aws][:access_key_id]
secret_access_key @node[:aws][:secret_access_key]
s3_bucket @node[:s3][:bucket_dump]
s3_file @node[:s3][:file]
s3_file @node[:s3][:file_dump]
download_dir "c:/tmp"
action :get
end

sql_dump=@node[:s3][:file]
sql_dump=@node[:s3][:file_dump]

# unpack the dump file. Example: mydump.sql.zip
if (@node[:s3][:file] =~ /(.*)\.(zip|7z|rar)/)
if (@node[:s3][:file_dump] =~ /(.*)\.(zip|7z|rar)/)
sql_dump=$1
Chef::Log.info("*** Unpacking database dump.")
powershell "Unpacking "+@node[:s3][:file] do
parameters({'PACKAGE' => @node[:s3][:file]})
powershell "Unpacking "+@node[:s3][:file_dump] do
parameters({'PACKAGE' => @node[:s3][:file_dump]})
# Create the powershell script
powershell_script = <<'POWERSHELL_SCRIPT'
cd c:/tmp
Expand Down

0 comments on commit 374e2e7

Please sign in to comment.