Sha256: 680cd9ef1225a99eb3d2a66e6606e68730ebf6242d5fc72c593ce287d4caaaf8

Contents?: true

Size: 1.1 KB

Versions: 6

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

require 'travis/cli/setup'

module Travis
  module CLI
    class Setup
      class S3 < Service
        description 'automatic pushing to S3'

        def run
          deploy 's3', 'push' do |config|
            config['access_key_id'] = ask('Access key ID: ').to_s
            config['secret_access_key'] = ask('Secret access key: ') { |q| q.echo = '*' }.to_s
            config['bucket'] = ask('Bucket: ').to_s
            local_dir = ask('Local project directory to upload (Optional): ').to_s
            config['local-dir'] = local_dir unless local_dir.empty?
            upload_dir = ask('S3 upload directory (Optional): ').to_s
            config['upload-dir'] = upload_dir unless upload_dir.empty?
            config['acl'] = ask('S3 ACL Settings (private, public_read, public_read_write, authenticated_read, bucket_owner_read, bucket_owner_full_control): ').to_s do |q|
              q.default = 'private'
            end
            encrypt(config, 'secret_access_key') if agree('Encrypt secret access key? ') { |q| q.default = 'yes' }
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
travis-1.14.0 lib/travis/cli/setup/s3.rb
travis-1.13.3 lib/travis/cli/setup/s3.rb
travis-1.13.2 lib/travis/cli/setup/s3.rb
travis-1.13.1 lib/travis/cli/setup/s3.rb
travis-1.13.0 lib/travis/cli/setup/s3.rb
travis-1.12.0 lib/travis/cli/setup/s3.rb