Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cdo
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
cdo
Commits
5bc6ed4c
Commit
5bc6ed4c
authored
8 years ago
by
Ralf Mueller
Browse files
Options
Downloads
Patches
Plain Diff
use simpler command execution for local stuff
the popen seem to left out things when calling 'cat config.log' locally
parent
5dffc322
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Rakefile
+5
-14
5 additions, 14 deletions
Rakefile
with
5 additions
and
14 deletions
Rakefile
+
5
−
14
View file @
5bc6ed4c
...
...
@@ -36,12 +36,14 @@ def getBranchName; `git branch`.split("\n").grep(/^\*/)[0].split[-1]; end
# stdout is shown in debug mode only
# stderr is always shown
def
executeLocal
(
cmd
)
system
(
cmd
)
return
Open3
.
popen3
(
cmd
)
{
|
stdin
,
stdout
,
stderr
,
external
|
# read from stdout and stderr in parallel
{
:out
=>
stdout
,
:err
=>
stderr
}.
each
{
|
key
,
stream
|
Thread
.
new
do
until
(
line
=
stream
.
gets
).
nil?
do
puts
line
.
chomp
if
:out
==
key
and
@debug
puts
line
.
chomp
if
:out
==
key
puts
line
.
chomp
.
colorize
(
color: :red
)
if
:err
==
key
end
end
...
...
@@ -150,16 +152,12 @@ def builder2task(builder,useHostAsName=false,syncSource=true)
modlistTaskName
=
"
#{
baseTaskName
}
_mods"
showLogTaskName
=
"
#{
baseTaskName
}
_showLog"
# collect things that should go into the general builder {{{
taskChain
=
[]
if
syncSource
then
#desc "sync files for host: #{builder.host}, branch: #{getBranchName}"
task
syncTaskName
.
to_sym
do
|
t
|
dbg
(
"sync source code for branch:"
+
getBranchName
)
doSync
(
builder
)
end
taskChain
<<
syncTaskName
end
#desc "configure on host: %s, compiler %s, branch: %s" % [builder.host, builder.compiler, getBranchName]
...
...
@@ -167,20 +165,16 @@ def builder2task(builder,useHostAsName=false,syncSource=true)
dbg
(
"call
#{
builder
.
configureCall
}
"
)
execute
(
"
#{
builder
.
configureCall
}
"
,
builder
)
end
taskChain
<<
configTaskName
#desc "build on host: %s, compiler %s, branch: %s" % [builder.host, builder.compiler, getBranchName]
task
buildTaskName
.
to_sym
do
|
t
|
execute
(
"make -j4"
,
builder
)
end
taskChain
<<
buildTaskName
#desc "check on host: %s, compiler %s, branch: %s" % [builder.host, builder.compiler, getBranchName]
task
checkTaskName
.
to_sym
do
|
t
|
execute
(
"make check"
,
builder
)
end
taskChain
<<
checkTaskName
# }}}
#desc "build on host: %s, compiler %s, branch: %s" % [builder.host, builder.compiler, getBranchName]
task
cleanTaskName
.
to_sym
do
|
t
|
...
...
@@ -203,9 +197,7 @@ def builder2task(builder,useHostAsName=false,syncSource=true)
end
desc
"builder for host:
#{
builder
.
hostname
}
, CC=
#{
builder
.
compiler
}
"
task
baseTaskName
.
to_sym
=>
taskChain
.
map
(
&
:to_sym
)
do
|
t
|
pp
builder
.
to_h
end
task
baseTaskName
.
to_sym
=>
[
syncTaskName
,
configTaskName
,
buildTaskName
,
checkTaskName
].
map
(
&
:to_sym
)
do
|
t
|
end
# }}}
# constuct builders out of user configuration {{{ ==============================
...
...
@@ -243,8 +235,7 @@ Builder = Struct.new(:host,:hostname,:username,:compiler,:targetDir,:configureCa
config
[
'configureCall'
],
(
'localhost'
==
config
[
'hostname'
]
\
or
'localhost'
==
@userConfig
[
'hosts'
][
config
[
'hostname'
]][
'hostname'
]
))
pp
builder
builder2task
(
builder
,
true
,
config
[
'sync'
])
builder2task
(
builder
,
true
,
config
[
'sync'
])
}
if
@userConfig
.
has_key?
(
'builders'
)
# }}}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment