dtc_rake 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/Gemfile +4 -0
- data/README.md +238 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/dtc_rake.gemspec +27 -0
- data/lib/dtc_rake/config.rb +112 -0
- data/lib/dtc_rake/product.rb +137 -0
- data/lib/dtc_rake/tasks.rb +28 -0
- data/lib/dtc_rake/ui.rb +49 -0
- data/lib/dtc_rake/util.rb +58 -0
- data/lib/dtc_rake/version.rb +3 -0
- data/lib/dtc_rake.rb +4 -0
- data/lib/tasks/appbox.rake +90 -0
- data/lib/tasks/build_all.rake +20 -0
- data/lib/tasks/build_cmd.rake +25 -0
- data/lib/tasks/build_dockerfiles.rake +51 -0
- data/lib/tasks/build_gem.rake +23 -0
- data/lib/tasks/build_vuc.rake +25 -0
- data/lib/tasks/build_yardoc.rake +57 -0
- data/lib/tasks/upload_all.rake +22 -0
- data/lib/tasks/upload_cmd.rake +40 -0
- data/lib/tasks/upload_descriptor.rb +41 -0
- data/lib/tasks/upload_dockerfiles.rake +40 -0
- data/lib/tasks/upload_gem.rake +40 -0
- data/lib/tasks/upload_vuc.rake +40 -0
- data/lib/tasks/upload_yardoc.rake +40 -0
- metadata +147 -0
@@ -0,0 +1,58 @@
|
|
1
|
+
require "rake"
|
2
|
+
require "dtc_rake/ui"
|
3
|
+
require "uu/os/attachment"
|
4
|
+
require "uu/os/rest/binary_value"
|
5
|
+
require "uu/os/search"
|
6
|
+
require "uu/os/security/session"
|
7
|
+
require "uu/os/uesuri_builder"
|
8
|
+
|
9
|
+
module DtcRake
|
10
|
+
include DtcRake::UI
|
11
|
+
|
12
|
+
def mv_to_output_dir(src_dir, src_file)
|
13
|
+
output_dir = DtcRake::Config.instance.output_dir
|
14
|
+
FileUtils.mkpath output_dir
|
15
|
+
src_file_path = File.join(src_dir, output_dir, src_file)
|
16
|
+
dest_file = File.expand_path(File.join(".", output_dir, src_file))
|
17
|
+
FileUtils.mv src_file_path, dest_file
|
18
|
+
success "#{dest_file} created"
|
19
|
+
end
|
20
|
+
module_function :mv_to_output_dir
|
21
|
+
|
22
|
+
# Checks if JRuby is being used. This check is important when building .war
|
23
|
+
# files - gems with native extensions (like json, bson) must be added to the
|
24
|
+
# output .war file for Java platform. Otherwise certain gems (e.g.
|
25
|
+
# uu_os_persistence) cannot be loaded when deployed on servlet container
|
26
|
+
# (Tomcat).
|
27
|
+
def check_jruby!
|
28
|
+
error(".war files must be built using JRuby!") unless RUBY_PLATFORM == "java"
|
29
|
+
end
|
30
|
+
module_function :check_jruby!
|
31
|
+
|
32
|
+
def upload_pack(attrs)
|
33
|
+
file = attrs[:file]
|
34
|
+
artifact_uri = attrs[:appbox_uri] || DtcRake::Product.instance.appbox_uri
|
35
|
+
attachment_code = attrs[:attachment_code]
|
36
|
+
credentials = attrs[:credentials]
|
37
|
+
|
38
|
+
abort "Specify login credentials" unless credentials
|
39
|
+
UU::OS::Security::Session.login(credentials)
|
40
|
+
|
41
|
+
attch_uri = UU::OS::UESURIBuilder.parse_uesuri(artifact_uri).set_object_code(attachment_code).to_uesuri
|
42
|
+
|
43
|
+
if UU::OS::Search.exists(attch_uri)
|
44
|
+
File.open(file, "rb") do |f|
|
45
|
+
UU::OS::Attachment.check_in(attch_uri, data: UU::OS::REST::BinaryValue.new(f))
|
46
|
+
end
|
47
|
+
else
|
48
|
+
File.open(file, "rb") do |f|
|
49
|
+
attch_uri = UU::OS::Attachment.create(artifact_uri, code: attachment_code,
|
50
|
+
data: UU::OS::REST::BinaryValue.new(f)
|
51
|
+
)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
attch_uri
|
56
|
+
end
|
57
|
+
module_function :upload_pack
|
58
|
+
end
|
data/lib/dtc_rake.rb
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
require "rake"
|
2
|
+
require "fileutils"
|
3
|
+
require "dtc_rake/config"
|
4
|
+
require "dtc_rake/product"
|
5
|
+
require "dtc_rake/ui"
|
6
|
+
|
7
|
+
require "uu/os/security/session"
|
8
|
+
require "uu/os/artifact"
|
9
|
+
require "uu/os/sheet"
|
10
|
+
require "uu/os/rest/binary_value"
|
11
|
+
|
12
|
+
include DtcRake::UI
|
13
|
+
|
14
|
+
def uesuri(art_code)
|
15
|
+
config = DtcRake::Config.instance
|
16
|
+
error("Territory code is not set. Set it in DtcRake.configure (attribute appbox_territory_code) in your Rakefile.") if config.appbox_territory_code.nil?
|
17
|
+
UU::OS::UESURI.create(
|
18
|
+
territory_code: config.appbox_territory_code,
|
19
|
+
artifact_code: art_code
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
def create_appbox(attrs)
|
24
|
+
config = DtcRake::Config.instance
|
25
|
+
product = DtcRake::Product.instance
|
26
|
+
credentials = attrs[:credentials]
|
27
|
+
version = attrs.fetch(:version, product.version)
|
28
|
+
icon = attrs.fetch(:icon, %q(ues:#{system}:#{ues_v5.core_v1.codetable_v1.base_v1.CodeTable_Icons}:#{ART_364}))
|
29
|
+
|
30
|
+
error("Specify appbox location code - set it in DtcRake.configure block (attribute appbox_location_code) in your Rakefile") unless config.appbox_location_code
|
31
|
+
error("Specify appbox meta artifact code - set it in DtcRake.configure block (attribute appbox_meta_artifact_code) in your Rakefile") unless config.appbox_meta_artifact_code
|
32
|
+
|
33
|
+
location = uesuri(config.appbox_location_code)
|
34
|
+
meta_artifact = uesuri(config.appbox_meta_artifact_code)
|
35
|
+
|
36
|
+
error("Specify login credentials") unless credentials
|
37
|
+
UU::OS::Security::Session.login(credentials)
|
38
|
+
|
39
|
+
config = DtcRake::Config.instance
|
40
|
+
art_name = "#{product.app_descriptor[:data][:name]} #{version}"
|
41
|
+
art_code = "#{product.app_descriptor[:data][:code]}_#{version}"
|
42
|
+
announce "Creating appbox #{art_code} in territory #{config.appbox_territory_code}"
|
43
|
+
|
44
|
+
appbox_uri = UU::OS::Artifact.create(location,
|
45
|
+
name: art_name,
|
46
|
+
code: art_code,
|
47
|
+
metaArtifactUri: meta_artifact,
|
48
|
+
iconUri: icon
|
49
|
+
)
|
50
|
+
|
51
|
+
appbox_uarchive = config.appbox_uarchive
|
52
|
+
unless appbox_uarchive.nil?
|
53
|
+
begin
|
54
|
+
sheet_uri = UU::OS::Sheet.get_sheet_list(appbox_uri, query: "main = true").first.uri
|
55
|
+
File.open(appbox_uarchive, "rb") do |f|
|
56
|
+
data = UU::OS::REST::BinaryValue.new(f)
|
57
|
+
data.content_type = UU::OS::Sheet::MimeType::UARCHIVE
|
58
|
+
UU::OS::Sheet.check_in(sheet_uri, :content => data)
|
59
|
+
end
|
60
|
+
rescue StandardError => e
|
61
|
+
warning "WARNING: Failed to fill in appbox content, skipping (cause: #{e.message})"
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
appbox_uri
|
66
|
+
end
|
67
|
+
|
68
|
+
desc <<-DESC.gsub(/^ {2}/, '')
|
69
|
+
Creates new appbox artifact; requires path to password file.
|
70
|
+
Vendor, app name and version are read from uuApp deployment descriptor.
|
71
|
+
Optionally, version can be overriden. Examples:
|
72
|
+
|
73
|
+
rake appbox DTC_RAKE_PASSWD=12-345-6
|
74
|
+
("~/.uu/12-345-6" will be used)
|
75
|
+
(version from client gem will be used)
|
76
|
+
|
77
|
+
rake appbox DTC_RAKE_PASSWD=/path/to/12-345-6
|
78
|
+
(password file from the specified path will be used)
|
79
|
+
|
80
|
+
rake appbox DTC_RAKE_PASSWD=12-345-6 VERSION=1.2.3
|
81
|
+
(the specified version will be used)
|
82
|
+
DESC
|
83
|
+
task :appbox do
|
84
|
+
error("Specify password file in env variable DTC_RAKE_PASSWD, e.g. rake appbox DTC_RAKE_PASSWD=12-345-6") unless ENV["DTC_RAKE_PASSWD"]
|
85
|
+
art_uri = create_appbox(
|
86
|
+
credentials: ENV["DTC_RAKE_PASSWD"],
|
87
|
+
version: ENV["VERSION"] || DtcRake::Product.instance.version
|
88
|
+
)
|
89
|
+
success "Appbox #{art_uri} created"
|
90
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "rake"
|
2
|
+
require "fileutils"
|
3
|
+
require "dtc_rake/config"
|
4
|
+
require "dtc_rake/product"
|
5
|
+
|
6
|
+
product = DtcRake::Product.instance
|
7
|
+
|
8
|
+
deps = []
|
9
|
+
if product.has_gem
|
10
|
+
deps << :gem
|
11
|
+
deps << :yardoc
|
12
|
+
end
|
13
|
+
deps << :cmd if product.has_cmd
|
14
|
+
deps << :vuc if product.has_vuc
|
15
|
+
deps << :dockerfiles if product.has_dockerfiles
|
16
|
+
|
17
|
+
namespace :build do
|
18
|
+
desc "Builds all packs"
|
19
|
+
task :all => deps
|
20
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require "rake"
|
2
|
+
require "fileutils"
|
3
|
+
require "dtc_rake/config"
|
4
|
+
require "dtc_rake/product"
|
5
|
+
require "dtc_rake/ui"
|
6
|
+
require "dtc_rake/util"
|
7
|
+
|
8
|
+
include DtcRake::UI
|
9
|
+
product = DtcRake::Product.instance
|
10
|
+
|
11
|
+
if product.has_cmd
|
12
|
+
namespace :build do
|
13
|
+
desc "Builds pack with command server"
|
14
|
+
task :cmd do
|
15
|
+
DtcRake.check_jruby!
|
16
|
+
announce "Building command server pack"
|
17
|
+
|
18
|
+
FileUtils.cd product.cmd_project do
|
19
|
+
system "rake package"
|
20
|
+
end
|
21
|
+
|
22
|
+
DtcRake.mv_to_output_dir(product.cmd_project, product.cmd_file_name)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require "rake"
|
2
|
+
require "fileutils"
|
3
|
+
require "dtc_rake/config"
|
4
|
+
require "dtc_rake/product"
|
5
|
+
require "dtc_rake/ui"
|
6
|
+
require "dtc_rake/util"
|
7
|
+
|
8
|
+
include DtcRake::UI
|
9
|
+
product = DtcRake::Product.instance
|
10
|
+
|
11
|
+
def build_dockerfiles(product)
|
12
|
+
begin
|
13
|
+
require "zip"
|
14
|
+
rescue LoadError
|
15
|
+
error "Gem rubyzip is not available. In order to use this task, you must: gem install rubyzip"
|
16
|
+
end
|
17
|
+
|
18
|
+
announce "Building Dockerfiles pack"
|
19
|
+
|
20
|
+
output_dir = DtcRake::Config.instance.output_dir
|
21
|
+
base_name = File.basename(product.dockerfiles_file_name, ".zip")
|
22
|
+
tmp_dir = File.join(output_dir, base_name)
|
23
|
+
FileUtils.rm_rf tmp_dir if File.directory? tmp_dir
|
24
|
+
FileUtils.mkdir_p tmp_dir
|
25
|
+
|
26
|
+
%w[
|
27
|
+
../docker
|
28
|
+
].each do |dir|
|
29
|
+
FileUtils.cp_r dir, tmp_dir
|
30
|
+
end
|
31
|
+
|
32
|
+
archive = File.join(output_dir, product.dockerfiles_file_name)
|
33
|
+
info "Creating #{archive}"
|
34
|
+
FileUtils.rm_f archive
|
35
|
+
Zip::File.open(archive, "w") do |zip|
|
36
|
+
Dir["#{tmp_dir}/**/**"].reject { |f| f == archive }.each do |file|
|
37
|
+
zip.add(file.sub("#{tmp_dir}/", ""), file)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
FileUtils.rm_rf tmp_dir
|
42
|
+
end
|
43
|
+
|
44
|
+
if product.has_dockerfiles
|
45
|
+
namespace :build do
|
46
|
+
desc "Builds pack with Dockerfiles"
|
47
|
+
task :dockerfiles do
|
48
|
+
build_dockerfiles(product)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require "rake"
|
2
|
+
require "fileutils"
|
3
|
+
require "dtc_rake/config"
|
4
|
+
require "dtc_rake/product"
|
5
|
+
require "dtc_rake/ui"
|
6
|
+
require "dtc_rake/util"
|
7
|
+
|
8
|
+
include DtcRake::UI
|
9
|
+
product = DtcRake::Product.instance
|
10
|
+
|
11
|
+
if product.has_gem
|
12
|
+
namespace :build do
|
13
|
+
desc "Builds pack with command client Ruby gem"
|
14
|
+
task :gem do
|
15
|
+
announce "Building command client Ruby gem pack"
|
16
|
+
FileUtils.cd product.gem_project do
|
17
|
+
system "rake package"
|
18
|
+
end
|
19
|
+
|
20
|
+
DtcRake.mv_to_output_dir(product.gem_project, product.gem_file_name)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require "rake"
|
2
|
+
require "fileutils"
|
3
|
+
require "dtc_rake/config"
|
4
|
+
require "dtc_rake/product"
|
5
|
+
require "dtc_rake/ui"
|
6
|
+
require "dtc_rake/util"
|
7
|
+
|
8
|
+
include DtcRake::UI
|
9
|
+
product = DtcRake::Product.instance
|
10
|
+
|
11
|
+
if product.has_vuc
|
12
|
+
namespace :build do
|
13
|
+
desc "Builds pack with visual use cases"
|
14
|
+
task :vuc do
|
15
|
+
DtcRake.check_jruby!
|
16
|
+
announce "Building visual use cases pack"
|
17
|
+
|
18
|
+
FileUtils.cd product.vuc_project do
|
19
|
+
system "rake package"
|
20
|
+
end
|
21
|
+
|
22
|
+
DtcRake.mv_to_output_dir(product.vuc_project, product.vuc_file_name)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require "rake"
|
2
|
+
require "fileutils"
|
3
|
+
require "dtc_rake/config"
|
4
|
+
require "dtc_rake/product"
|
5
|
+
require "dtc_rake/ui"
|
6
|
+
require "dtc_rake/util"
|
7
|
+
|
8
|
+
include DtcRake::UI
|
9
|
+
product = DtcRake::Product.instance
|
10
|
+
|
11
|
+
def build_yardoc(product)
|
12
|
+
begin
|
13
|
+
require "zip"
|
14
|
+
rescue LoadError
|
15
|
+
error "Gem rubyzip is not available. In order to use this task, you must: gem install rubyzip"
|
16
|
+
end
|
17
|
+
|
18
|
+
announce "Building command client yardoc pack"
|
19
|
+
|
20
|
+
output_dir = DtcRake::Config.instance.output_dir
|
21
|
+
archive = product.yardoc_file_name
|
22
|
+
tmp_dir = File.basename(archive, ".zip")
|
23
|
+
|
24
|
+
FileUtils.cd product.gem_project do
|
25
|
+
[
|
26
|
+
File.join(output_dir, tmp_dir),
|
27
|
+
File.join(output_dir, "doc")
|
28
|
+
].each do |dir|
|
29
|
+
FileUtils.rm_rf dir if File.directory? dir
|
30
|
+
end
|
31
|
+
|
32
|
+
system "yardoc"
|
33
|
+
|
34
|
+
FileUtils.cd output_dir do
|
35
|
+
FileUtils.mv "doc", tmp_dir
|
36
|
+
|
37
|
+
info "Creating #{archive}"
|
38
|
+
FileUtils.rm_f archive
|
39
|
+
Zip::File.open(archive, "w") do |zip|
|
40
|
+
Dir["#{tmp_dir}/**/**"].reject { |f| f == archive }.each do |file|
|
41
|
+
zip.add(file.sub("target/", ""), file)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
DtcRake.mv_to_output_dir(product.gem_project, archive)
|
48
|
+
end
|
49
|
+
|
50
|
+
if product.has_gem
|
51
|
+
namespace :build do
|
52
|
+
desc "Builds pack with command client yardoc"
|
53
|
+
task :yardoc do
|
54
|
+
build_yardoc(product)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require "rake"
|
2
|
+
require "fileutils"
|
3
|
+
require "dtc_rake/config"
|
4
|
+
require "dtc_rake/product"
|
5
|
+
|
6
|
+
product = DtcRake::Product.instance
|
7
|
+
config = DtcRake::Config.instance
|
8
|
+
|
9
|
+
deps = []
|
10
|
+
if product.has_gem
|
11
|
+
deps << :gem
|
12
|
+
deps << :yardoc
|
13
|
+
end
|
14
|
+
deps << :cmd if product.has_cmd
|
15
|
+
deps << :vuc if product.has_vuc
|
16
|
+
deps << :dockerfiles if product.has_dockerfiles
|
17
|
+
deps << :descriptor if config.upload_app_descriptor
|
18
|
+
|
19
|
+
namespace :upload do
|
20
|
+
desc "Uploads all packs to appbox artifact; requires path to password file"
|
21
|
+
task :all => deps
|
22
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require "rake"
|
2
|
+
require "fileutils"
|
3
|
+
require "dtc_rake/config"
|
4
|
+
require "dtc_rake/product"
|
5
|
+
require "dtc_rake/ui"
|
6
|
+
require "dtc_rake/util"
|
7
|
+
|
8
|
+
include DtcRake::UI
|
9
|
+
product = DtcRake::Product.instance
|
10
|
+
|
11
|
+
if product.has_cmd
|
12
|
+
namespace :upload do
|
13
|
+
desc <<-DESC.gsub(/^ {4}/, '')
|
14
|
+
Uploads pack with command server to appbox artifact; requires path to password file.
|
15
|
+
|
16
|
+
rake upload:cmd DTC_RAKE_PASSWD=12-345-6
|
17
|
+
("~/.uu/12-345-6" will be used)
|
18
|
+
|
19
|
+
rake upload:cmd DTC_RAKE_PASSWD=/path/to/12-345-6
|
20
|
+
(password file from the specified path will be used)
|
21
|
+
DESC
|
22
|
+
task :cmd => ["build:cmd"] do
|
23
|
+
error("Specify password file in env variable DTC_RAKE_PASSWD, e.g. rake upload:cmd DTC_RAKE_PASSWD=12-345-6") unless ENV["DTC_RAKE_PASSWD"]
|
24
|
+
|
25
|
+
pack_file = File.join(DtcRake::Config.instance.output_dir, product.cmd_file_name)
|
26
|
+
error("File #{pack_file} does not exist") unless File.file?(pack_file)
|
27
|
+
|
28
|
+
art_uri = product.appbox_uri
|
29
|
+
attch_code = product.cmd_attachment_code
|
30
|
+
announce "Uploading #{pack_file} to #{art_uri}:#{attch_code}..."
|
31
|
+
attch_uri = DtcRake.upload_pack(
|
32
|
+
file: pack_file,
|
33
|
+
appbox_uri: art_uri,
|
34
|
+
attachment_code: attch_code,
|
35
|
+
credentials: ENV["DTC_RAKE_PASSWD"]
|
36
|
+
)
|
37
|
+
success "File #{pack_file} uploaded to #{attch_uri}"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require "rake"
|
2
|
+
require "fileutils"
|
3
|
+
require "dtc_rake/config"
|
4
|
+
require "dtc_rake/product"
|
5
|
+
require "dtc_rake/ui"
|
6
|
+
require "dtc_rake/util"
|
7
|
+
|
8
|
+
include DtcRake::UI
|
9
|
+
product = DtcRake::Product.instance
|
10
|
+
config = DtcRake::Config.instance
|
11
|
+
|
12
|
+
if config.upload_app_descriptor
|
13
|
+
namespace :upload do
|
14
|
+
desc <<-DESC.gsub(/^ {4}/, '')
|
15
|
+
Uploads uuApp deployment descriptor to appbox artifact; requires path to password file.
|
16
|
+
|
17
|
+
rake upload:descriptor DTC_RAKE_PASSWD=12-345-6
|
18
|
+
("~/.uu/12-345-6" will be used)
|
19
|
+
|
20
|
+
rake upload:descriptor DTC_RAKE_PASSWD=/path/to/12-345-6
|
21
|
+
(password file from the specified path will be used)
|
22
|
+
DESC
|
23
|
+
task :descriptor do
|
24
|
+
error("Specify password file in env variable DTC_RAKE_PASSWD, e.g. rake upload:descriptor DTC_RAKE_PASSWD=12-345-6") unless ENV["DTC_RAKE_PASSWD"]
|
25
|
+
|
26
|
+
the_file = File.join(config.output_dir, config.app_descriptor_path)
|
27
|
+
error("File #{the_file} does not exist") unless File.file?(the_file)
|
28
|
+
|
29
|
+
art_uri = product.appbox_uri
|
30
|
+
attch_code = product.app_descriptor_attachment_code
|
31
|
+
announce "Uploading #{the_file} to #{art_uri}:#{attch_code}..."
|
32
|
+
attch_uri = DtcRake.upload_pack(
|
33
|
+
file: the_file,
|
34
|
+
appbox_uri: art_uri,
|
35
|
+
attachment_code: attch_code,
|
36
|
+
credentials: ENV["DTC_RAKE_PASSWD"]
|
37
|
+
)
|
38
|
+
success "File #{the_file} uploaded to #{attch_uri}"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require "rake"
|
2
|
+
require "fileutils"
|
3
|
+
require "dtc_rake/config"
|
4
|
+
require "dtc_rake/product"
|
5
|
+
require "dtc_rake/ui"
|
6
|
+
require "dtc_rake/util"
|
7
|
+
|
8
|
+
include DtcRake::UI
|
9
|
+
product = DtcRake::Product.instance
|
10
|
+
|
11
|
+
if product.has_dockerfiles
|
12
|
+
namespace :upload do
|
13
|
+
desc <<-DESC.gsub(/^ {4}/, '')
|
14
|
+
Uploads pack with Dockerfiles to appbox artifact; requires path to password file.
|
15
|
+
|
16
|
+
rake upload:dockerfiles DTC_RAKE_PASSWD=12-345-6
|
17
|
+
("~/.uu/12-345-6" will be used)
|
18
|
+
|
19
|
+
rake upload:dockerfiles DTC_RAKE_PASSWD=/path/to/12-345-6
|
20
|
+
(password file from the specified path will be used)
|
21
|
+
DESC
|
22
|
+
task :dockerfiles => ["build:dockerfiles"] do
|
23
|
+
error("Specify password file in env variable DTC_RAKE_PASSWD, e.g. rake upload:dockerfiles DTC_RAKE_PASSWD=12-345-6") unless ENV["DTC_RAKE_PASSWD"]
|
24
|
+
|
25
|
+
pack_file = File.join(DtcRake::Config.instance.output_dir, product.dockerfiles_file_name)
|
26
|
+
error("File #{pack_file} does not exist") unless File.file?(pack_file)
|
27
|
+
|
28
|
+
art_uri = product.appbox_uri
|
29
|
+
attch_code = product.dockerfiles_attachment_code
|
30
|
+
announce "Uploading #{pack_file} to #{art_uri}:#{attch_code}..."
|
31
|
+
attch_uri = DtcRake.upload_pack(
|
32
|
+
file: pack_file,
|
33
|
+
appbox_uri: art_uri,
|
34
|
+
attachment_code: attch_code,
|
35
|
+
credentials: ENV["DTC_RAKE_PASSWD"]
|
36
|
+
)
|
37
|
+
success "File #{pack_file} uploaded to #{attch_uri}"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require "rake"
|
2
|
+
require "fileutils"
|
3
|
+
require "dtc_rake/config"
|
4
|
+
require "dtc_rake/product"
|
5
|
+
require "dtc_rake/ui"
|
6
|
+
require "dtc_rake/util"
|
7
|
+
|
8
|
+
include DtcRake::UI
|
9
|
+
product = DtcRake::Product.instance
|
10
|
+
|
11
|
+
if product.has_gem
|
12
|
+
namespace :upload do
|
13
|
+
desc <<-DESC.gsub(/^ {4}/, '')
|
14
|
+
Uploads pack with command client Ruby gem to appbox artifact; requires path to password file.
|
15
|
+
|
16
|
+
rake upload:gem DTC_RAKE_PASSWD=12-345-6
|
17
|
+
("~/.uu/12-345-6" will be used)
|
18
|
+
|
19
|
+
rake upload:gem DTC_RAKE_PASSWD=/path/to/12-345-6
|
20
|
+
(password file from the specified path will be used)
|
21
|
+
DESC
|
22
|
+
task :gem => ["build:gem"] do
|
23
|
+
error("Specify password file in env variable DTC_RAKE_PASSWD, e.g. rake upload:gem DTC_RAKE_PASSWD=12-345-6") unless ENV["DTC_RAKE_PASSWD"]
|
24
|
+
|
25
|
+
pack_file = File.join(DtcRake::Config.instance.output_dir, product.gem_file_name)
|
26
|
+
error("File #{pack_file} does not exist") unless File.file?(pack_file)
|
27
|
+
|
28
|
+
art_uri = product.appbox_uri
|
29
|
+
attch_code = product.gem_attachment_code
|
30
|
+
announce "Uploading #{pack_file} to #{art_uri}:#{attch_code}..."
|
31
|
+
attch_uri = DtcRake.upload_pack(
|
32
|
+
file: pack_file,
|
33
|
+
appbox_uri: art_uri,
|
34
|
+
attachment_code: attch_code,
|
35
|
+
credentials: ENV["DTC_RAKE_PASSWD"]
|
36
|
+
)
|
37
|
+
success "File #{pack_file} uploaded to #{attch_uri}"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require "rake"
|
2
|
+
require "fileutils"
|
3
|
+
require "dtc_rake/config"
|
4
|
+
require "dtc_rake/product"
|
5
|
+
require "dtc_rake/ui"
|
6
|
+
require "dtc_rake/util"
|
7
|
+
|
8
|
+
include DtcRake::UI
|
9
|
+
product = DtcRake::Product.instance
|
10
|
+
|
11
|
+
if product.has_vuc
|
12
|
+
namespace :upload do
|
13
|
+
desc <<-DESC.gsub(/^ {4}/, '')
|
14
|
+
Uploads pack with visual use cases to appbox artifact; requires path to password file.
|
15
|
+
|
16
|
+
rake upload:vuc DTC_RAKE_PASSWD=12-345-6
|
17
|
+
("~/.uu/12-345-6" will be used)
|
18
|
+
|
19
|
+
rake upload:vuc DTC_RAKE_PASSWD=/path/to/12-345-6
|
20
|
+
(password file from the specified path will be used)
|
21
|
+
DESC
|
22
|
+
task :vuc => ["build:vuc"] do
|
23
|
+
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"]
|
24
|
+
|
25
|
+
pack_file = File.join(DtcRake::Config.instance.output_dir, product.vuc_file_name)
|
26
|
+
error("File #{pack_file} does not exist") unless File.file?(pack_file)
|
27
|
+
|
28
|
+
art_uri = product.appbox_uri
|
29
|
+
attch_code = product.vuc_attachment_code
|
30
|
+
announce "Uploading #{pack_file} to #{art_uri}:#{attch_code}..."
|
31
|
+
attch_uri = DtcRake.upload_pack(
|
32
|
+
file: pack_file,
|
33
|
+
appbox_uri: art_uri,
|
34
|
+
attachment_code: attch_code,
|
35
|
+
credentials: ENV["DTC_RAKE_PASSWD"]
|
36
|
+
)
|
37
|
+
success "File #{pack_file} uploaded to #{attch_uri}"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require "rake"
|
2
|
+
require "fileutils"
|
3
|
+
require "dtc_rake/config"
|
4
|
+
require "dtc_rake/product"
|
5
|
+
require "dtc_rake/ui"
|
6
|
+
require "dtc_rake/util"
|
7
|
+
|
8
|
+
include DtcRake::UI
|
9
|
+
product = DtcRake::Product.instance
|
10
|
+
|
11
|
+
if product.has_gem
|
12
|
+
namespace :upload do
|
13
|
+
desc <<-DESC.gsub(/^ {4}/, '')
|
14
|
+
Uploads pack with command client yardoc to appbox artifact; requires path to password file.
|
15
|
+
|
16
|
+
rake upload:yardoc DTC_RAKE_PASSWD=12-345-6
|
17
|
+
("~/.uu/12-345-6" will be used)
|
18
|
+
|
19
|
+
rake upload:yardoc DTC_RAKE_PASSWD=/path/to/12-345-6
|
20
|
+
(password file from the specified path will be used)
|
21
|
+
DESC
|
22
|
+
task :yardoc => ["build:yardoc"] do
|
23
|
+
error("Specify password file in env variable DTC_RAKE_PASSWD, e.g. rake upload:yardoc DTC_RAKE_PASSWD=12-345-6") unless ENV["DTC_RAKE_PASSWD"]
|
24
|
+
|
25
|
+
pack_file = File.join(DtcRake::Config.instance.output_dir, product.yardoc_file_name)
|
26
|
+
error("File #{pack_file} does not exist") unless File.file?(pack_file)
|
27
|
+
|
28
|
+
art_uri = product.appbox_uri
|
29
|
+
attch_code = product.yardoc_attachment_code
|
30
|
+
announce "Uploading #{pack_file} to #{art_uri}:#{attch_code}..."
|
31
|
+
attch_uri = DtcRake.upload_pack(
|
32
|
+
file: pack_file,
|
33
|
+
appbox_uri: art_uri,
|
34
|
+
attachment_code: attch_code,
|
35
|
+
credentials: ENV["DTC_RAKE_PASSWD"]
|
36
|
+
)
|
37
|
+
success "File #{pack_file} uploaded to #{attch_uri}"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|