Class: Ploy::Command::Publish
Instance Method Summary collapse
Instance Method Details
#help ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/ploy/command/publish.rb', line 28 def help return "usage: ploy publish [config.yml]\n\nExamples:\n\n $ ploy publish\n $ ploy publish something.yml\n\nConfig Example:\n\n ---\n bucket: bucketname\n deploy_name: some-project\n dist_dir: spec/resources/dist\n prep_cmd: lineman build\n prefix: /usr/local/someproject\n upstart_files:\n - spec/resources/conf/some-project-initfile\n\nSummary:\n\n The publish command takes a config YAML file as input, and uses that to construct a\n debian package file and push it into a particular location in S3\n\n" end |
#is_pull_request_build ⇒ Object
23 24 25 26 |
# File 'lib/ploy/command/publish.rb', line 23 def is_pull_request_build() prenv = ENV['TRAVIS_PULL_REQUEST'] return prenv && (prenv != 'false') end |
#run(argv) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/ploy/command/publish.rb', line 7 def run(argv) if not is_pull_request_build then published = Ploy::Publisher.new(argv.shift || '.ploy-publisher.yml').publish if published.length > 0 then published.each do |res| puts "ploy publish (#{res.deploy_name} #{res.branch} #{res.version}) ok" end end #puts "debug: git rev-parse: #{`git rev-parse HEAD`.chomp}" #puts "debug: git symbolic-ref: #{`git symbolic-ref -q HEAD |sed -e 's/.*\\///'`.chomp}" else puts "skipping publish; this is a PR build" end return true end |