Class: Egads::Build
Defined Under Namespace
Modules: BuildHelpers
Instance Attribute Summary collapse
Instance Method Summary
collapse
#can_build?, #error, #patch_path, #sha_is_checked_out?, #should_build?, #working_directory_is_clean?
#sha, #short_sha, #tarball
Methods inherited from Group
exit_on_failure?
Instance Attribute Details
#build_sha ⇒ Object
Returns the value of attribute build_sha.
11
12
13
|
# File 'lib/egads/command/build.rb', line 11
def build_sha
@build_sha
end
|
Instance Method Details
#check_build ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
|
# 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
|
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/egads/command/build.rb', line 33
def
exit 1 unless sha_is_checked_out?
= ["REVISION"]
+= Config.
run_with_code("git add -f #{ * ' '} && git commit --no-verify -m '[egads seed] [ci skip]'")
self.build_sha = run_with_code("git rev-parse --verify HEAD").strip
run_with_code "git reset #{sha}"
end
|
#make_tarball ⇒ Object
46
47
48
|
# 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 ⇒ Object
50
51
52
|
# File 'lib/egads/command/build.rb', line 50
def run_after_build_hooks
run_hooks_for(:build, :after)
end
|
#run_before_build_hooks ⇒ Object
25
26
27
|
# File 'lib/egads/command/build.rb', line 25
def run_before_build_hooks
run_hooks_for(:build, :before)
end
|
#upload ⇒ Object
54
55
56
|
# 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 ⇒ Object
29
30
31
|
# File 'lib/egads/command/build.rb', line 29
def write_revision_file
File.open('REVISION', 'w') {|f| f << sha + "\n" }
end
|