File tree 1 file changed +4
-19
lines changed
1 file changed +4
-19
lines changed Original file line number Diff line number Diff line change @@ -93,20 +93,6 @@ def build(branch=nil)
93
93
Thread . new { build! ( branch ) }
94
94
end
95
95
96
- def open_pipe ( cmd )
97
- read , write = IO . pipe
98
-
99
- pid = fork do
100
- read . close
101
- $stdout. reopen write
102
- exec cmd
103
- end
104
-
105
- write . close
106
-
107
- yield read , pid
108
- end
109
-
110
96
# update git then run the build
111
97
def build! ( branch = nil )
112
98
@git_branch = branch
@@ -117,12 +103,11 @@ def build!(branch=nil)
117
103
build . branch = git_branch
118
104
write_build 'current' , build
119
105
120
- open_pipe ( "cd #{ @project_path } && #{ runner_command } 2>&1" ) do |pipe , pid |
121
- puts "#{ Time . now . to_i } : Building #{ build . branch } at #{ build . short_sha } : pid=#{ pid } "
122
-
123
- build . pid = pid
106
+ IO . popen ( "cd #{ @project_path } && #{ runner_command } 2>&1" ) do |io |
107
+ puts "#{ Time . now . to_i } : Building #{ build . branch } at #{ build . short_sha } : pid=#{ io . pid } "
108
+ output = io . read
109
+ build . pid = io . pid
124
110
write_build 'current' , build
125
- output = pipe . read
126
111
end
127
112
128
113
Process . waitpid ( build . pid , 1 )
You can’t perform that action at this time.
0 commit comments