28
28
def teardown
29
29
if container_exists
30
30
puts "Stopping #{ @container } "
31
- run_command ( "docker stop #{ @container } " )
32
- run_command ( "docker rm #{ @container } " )
31
+ run_command ( "docker stop #{ @container } " , silent : false , print_command : true )
32
+ run_command ( "docker rm #{ @container } " , silent : false , print_command : true )
33
33
end
34
34
end
35
35
36
36
def start_container ( ezbake_dir )
37
- run_command ( "docker run -d --name #{ @container } -v .:/code -v #{ ezbake_dir } :/ezbake #{ @image } /bin/sh -c 'tail -f /dev/null'" )
37
+ run_command ( "docker run -d --name #{ @container } -v .:/code -v #{ ezbake_dir } :/ezbake #{ @image } /bin/sh -c 'tail -f /dev/null'" , silent : false , print_command : true )
38
38
end
39
39
40
40
def run ( cmd )
41
- puts "\033 [32mRunning #{ cmd } \033 [0m"
42
- run_command ( "docker exec #{ @container } /bin/bash --login -c '#{ cmd } '" )
41
+ run_command ( "docker exec #{ @container } /bin/bash --login -c '#{ cmd } '" , silent : false , print_command : true )
43
42
end
44
43
45
44
namespace :vox do
@@ -53,15 +52,15 @@ namespace :vox do
53
52
# delete all containers and do `docker rmi ezbake-builder`
54
53
unless image_exists
55
54
puts "Building ezbake-builder image"
56
- run_command ( "docker build -t ezbake-builder ." )
55
+ run_command ( "docker build -t ezbake-builder ." , silent : false , print_command : true )
57
56
end
58
57
59
58
puts "Checking out ezbake"
60
59
tmp = Dir . mktmpdir ( "ezbake" )
61
60
ezbake_dir = "#{ tmp } /ezbake"
62
- run_command ( "git clone https://github.com/openvoxproject/ezbake #{ ezbake_dir } " )
61
+ run_command ( "git clone https://github.com/openvoxproject/ezbake #{ ezbake_dir } " , silent : false , print_command : true )
63
62
ezbake_branch = ENV [ 'EZBAKE_BRANCH' ] || 'main'
64
- Dir . chdir ( ezbake_dir ) { |_ | run_command ( "git checkout #{ ezbake_branch } " ) }
63
+ Dir . chdir ( ezbake_dir ) { |_ | run_command ( "git checkout #{ ezbake_branch } " , silent : false , print_command : true ) }
65
64
66
65
puts "Starting container"
67
66
teardown if container_exists
@@ -73,7 +72,7 @@ namespace :vox do
73
72
puts "Building openvoxdb"
74
73
run ( "cd /code && rm -rf ruby && rm -rf output && bundle install --without test && lein install" )
75
74
run ( "cd /code && COW=\" #{ @debs } \" MOCK=\" #{ @rpms } \" GEM_SOURCE='https://rubygems.org' EZBAKE_ALLOW_UNREPRODUCIBLE_BUILDS=true EZBAKE_NODEPLOY=true LEIN_PROFILES=ezbake lein with-profile user,ezbake,provided,internal ezbake local-build" )
76
- run_command ( "sudo chown -R $USER output" )
75
+ run_command ( "sudo chown -R $USER output" , print_command : true )
77
76
Dir . glob ( 'output/**/*i386*' ) . each { |f | FileUtils . rm_rf ( f ) }
78
77
Dir . glob ( 'output/puppetdb-*.tar.gz' ) . each { |f | FileUtils . mv ( f , f . sub ( 'puppetdb' , 'openvoxdb' ) ) }
79
78
ensure
0 commit comments