Sha256: a7052286bee2e32c74e6a1ef7e5570ec60586c397e3809b45da239fe4835b838

Contents?: true

Size: 1.3 KB

Versions: 9

Compression:

Stored size: 1.3 KB

Contents

require "rake"
require "fileutils"
require "dtc_rake/config"
require "dtc_rake/product"
require "dtc_rake/ui"
require "dtc_rake/util"

include DtcRake::UI
product = DtcRake::Product.instance

if product.has_vuc
  namespace :upload do
    desc <<-DESC.gsub(/^ {4}/, '')
      Uploads pack with visual use cases to appbox artifact; requires path to password file.

      rake upload:vuc DTC_RAKE_PASSWD=12-345-6
      ("~/.uu/12-345-6" will be used)

      rake upload:vuc DTC_RAKE_PASSWD=/path/to/12-345-6
      (password file from the specified path will be used)
    DESC
    task :vuc => ["build:vuc"] do
      error("Specify password file in env variable DTC_RAKE_PASSWD, e.g. rake upload:vuc DTC_RAKE_PASSWD=12-345-6") unless ENV["DTC_RAKE_PASSWD"]

      pack_file = File.join(DtcRake::Config.instance.output_dir, product.vuc_file_name)
      error("File #{pack_file} does not exist") unless File.file?(pack_file)

      art_uri = product.appbox_uri
      attch_code = product.vuc_attachment_code
      announce "Uploading #{pack_file} to #{art_uri}:#{attch_code}..."
      attch_uri = DtcRake.upload_pack(
        file: pack_file,
        appbox_uri: art_uri,
        attachment_code: attch_code,
        credentials: ENV["DTC_RAKE_PASSWD"]
      )
      success "File #{pack_file} uploaded to #{attch_uri}"
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
dtc_rake-1.2.1 lib/tasks/upload_vuc.rake
dtc_rake-1.2.0 lib/tasks/upload_vuc.rake
dtc_rake-1.1.0 lib/tasks/upload_vuc.rake
dtc_rake-1.0.0 lib/tasks/upload_vuc.rake
dtc_rake-1.0.0.pre.beta.2 lib/tasks/upload_vuc.rake
dtc_rake-1.0.0.pre.beta.1 lib/tasks/upload_vuc.rake
dtc_rake-0.2.0 lib/tasks/upload_vuc.rake
dtc_rake-0.1.2 lib/tasks/upload_vuc.rake
dtc_rake-0.1.0 lib/tasks/upload_vuc.rake