Class: Vx::Builder::Script::Artifacts
- Inherits:
-
Struct
- Object
- Struct
- Vx::Builder::Script::Artifacts
- Includes:
- Helper::TraceShCommand
- Defined in:
- lib/vx/builder/script/artifacts.rb
Constant Summary collapse
- FIND =
'find . -type f -path "./%s" | sed "s/^\.\///g"'
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
Instance Method Summary collapse
Methods included from Helper::TraceShCommand
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app
5 6 7 |
# File 'lib/vx/builder/script/artifacts.rb', line 5 def app @app end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/vx/builder/script/artifacts.rb', line 11 def call(env) rs = app.call env if enabled?(env) env.after_script << "echo" env.source.artifacts.files.map{|a| compile(a) }.each do |artifact| find = FIND % artifact url = env.task.artifacts_url_prefix prefix = env.source.artifacts.prefix name = prefix ? "#{prefix}$i" : "$i" cmd = %{ for i in $(#{find}) ; do echo "upload artifact #{name}" curl -s -S -X PUT -T $i #{url}/#{name} > /dev/null done } env.after_script << cmd end env.after_script << "echo" end rs end |