class Egads::Build

Attributes

build_sha[RW]

Public Instance Methods

check_build() click to toggle source
# File lib/egads/command/build.rb, line 13
def check_build
  say_status :rev, "#{rev} parsed to #{sha}"

  unless should_build?
    say_status :done, "tarball for #{sha} already exists. Pass --force to rebuild."
    exit 0
  end

  exit 1 unless can_build?
  say_status :build, "Making tarball for #{sha}", :yellow
end
commit_extra_paths() click to toggle source
# File lib/egads/command/build.rb, line 33
def commit_extra_paths
  # Double-check that SHA hasn't changed since we started building
  exit 1 unless sha_is_checked_out?

  extra_paths = ["REVISION"]
  extra_paths += Config.build_extra_paths
  run_with_code("git add -f #{extra_paths * ' '} && git commit --no-verify -m '[egads seed] [ci skip]'")
  # Get the build SHA
  self.build_sha = run_with_code("git rev-parse --verify HEAD").strip
  run_with_code "git reset #{sha}" # Reset to original SHA

end
make_tarball() click to toggle source
# File lib/egads/command/build.rb, line 46
def make_tarball
  run_with_code "git archive #{build_sha} --output #{tarball.local_tar_path}"
end
run_after_build_hooks() click to toggle source
# File lib/egads/command/build.rb, line 50
def run_after_build_hooks
  run_hooks_for(:build, :after)
end
run_before_build_hooks() click to toggle source
# File lib/egads/command/build.rb, line 25
def run_before_build_hooks
  run_hooks_for(:build, :before)
end
upload() click to toggle source
# File lib/egads/command/build.rb, line 54
def upload
  invoke(Egads::Upload, [sha], force: options[:force]) unless options['no-upload']
end
write_revision_file() click to toggle source
# File lib/egads/command/build.rb, line 29
def write_revision_file
  File.open('REVISION', 'w') {|f| f << sha + "\n" }
end