Class: Ploy::Command::Publish
Instance Method Summary collapse
Instance Method Details
#help ⇒ Object
26 27 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 |
# File 'lib/ploy/command/publish.rb', line 26 def help return <<helptext usage: ploy publish [config.yml] Examples: $ ploy publish $ ploy publish something.yml Config Example: --- bucket: bucketname deploy_name: some-project dist_dir: spec/resources/dist prep_cmd: lineman build prefix: /usr/local/someproject upstart_files: - spec/resources/conf/some-project-initfile Summary: The publish command takes a config YAML file as input, and uses that to construct a debian package file and push it into a particular location in S3 helptext end |
#is_pull_request_build ⇒ Object
21 22 23 24 |
# File 'lib/ploy/command/publish.rb', line 21 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 |
# File 'lib/ploy/command/publish.rb', line 7 def run(argv) if not is_pull_request_build then res = Ploy::Publisher.new(argv.shift || '.ploy-publisher.yml').publish if res then puts "ploy publish (#{res.deploy_name} #{res.branch} #{res.version}) ok" end puts "debug: git rev-parse: #{`git rev-parse HEAD`.chomp}" puts "debug: git symbolic-ref: #{`git symbolic-ref --short -q HEAD`.chomp}" else puts "skipping publish; this is a PR build" end return true end |