lib/datapimp/cli/create.rb in datapimp-1.2.1 vs lib/datapimp/cli/create.rb in datapimp-1.2.2
- old
+ new
@@ -1,7 +1,7 @@
command 'create cache invalidations' do |c|
- c.syntax = 'datapimp create cache invalidations'
+ c.syntax = "#{$datapimp_cli} create cache invalidations"
c.description = 'invalidate remote cache layers (i.e. cloudfront after a s3 deploy)'
Datapimp::Cli.accepts_keys_for(c, :amazon)
c.option '--all-html', 'Invalidate all HTML paths in the bucket'
@@ -73,11 +73,11 @@
end
end
end
command 'create s3 bucket' do |c|
- c.syntax = 'datapimp create s3 bucket BUCKETNAME'
+ c.syntax = "#{$datapimp_cli} create s3 bucket BUCKETNAME"
c.description = 'create an s3 bucket to use for website hosting'
Datapimp::Cli.accepts_keys_for(c, :amazon)
c.option '--setup-website', 'Setup the bucket for website hosting'
@@ -88,18 +88,20 @@
Datapimp::Sync::S3Bucket.new(remote: args.first, redirect: !!(options.create_redirect_bucket), setup_website: !!(options.setup_website)).run_create_action()
end
end
command 'create cloudfront distribution' do |c|
- c.syntax = "datapimp create cloudfront distribution"
+ c.syntax = "#{$datapimp_cli} create cloudfront distribution"
c.description = "create a cloudfront distribution to link to a specific bucket"
Datapimp::Cli.accepts_keys_for(c, :amazon)
c.option '--bucket NAME', String, 'The name of the bucket that will provide the content'
c.option '--domains DOMAINS', Array, 'What domains will be pointing to this bucket?'
c.action do |args, options|
+ options.default(bucket: args.first)
+
bucket = Datapimp::Sync::S3Bucket.new(remote: options.bucket)
cdn_options = {
enabled: true,
custom_origin: {