Sha256: 53d1d59fdc163f0e00fcd8326507901173ce109c9f988e032d60a25531a169de
Contents?: true
Size: 1.08 KB
Versions: 1
Compression:
Stored size: 1.08 KB
Contents
module Soaring class Packager def initialize(options) @options = options end def package(project_folder) build_output_location = generate_build_output_location(project_folder) `zip -r #{build_output_location} * .ebextensions -x build -x config/environment.yml` puts "Build packaged at #{build_output_location}" end private def validate_project if (not is_git_repo_up_to_date?) and (not @options[:ignore_git_checks]) puts "Local git repo is dirty and should not be packaged" exit 1 end puts 'Local git repo up to date.' if @options[:verbose] end def generate_build_output_location(project_folder) service_name = File.split(project_folder)[-1] revision_hash = `git rev-parse --short HEAD`.chomp timestamp = Time.now.strftime("%F-%H%M%S") "#{project_folder}/build/build_#{service_name}_#{revision_hash}_#{timestamp}.zip" end def is_git_repo_up_to_date? git_response = `git status --porcelain`.chomp return true if '' == git_response false end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
soaring-0.1.4 | lib/soaring/packager.rb |