Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beaver
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
orus-io
beaver
Merge requests
!4
Few updates from downstream
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Few updates from downstream
topic/default/from-scl
into
branch/default
Overview
0
Commits
8
Pipelines
3
Changes
1
Merged
steeve.chailloux
requested to merge
topic/default/from-scl
into
branch/default
1 year ago
Overview
0
Commits
8
Pipelines
3
Changes
1
Expand
See commit messages.
0
0
Merge request reports
Viewing commit
17ff43b0
Prev
Next
Show latest version
1 file
+
25
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
17ff43b0
parallel build
· 17ff43b0
steeve.chailloux
authored
1 year ago
runner/main.go
+
25
−
6
Options
@@ -8,6 +8,7 @@
"os"
"path/filepath"
"strings"
"sync"
"github.com/go-cmd/cmd"
"gopkg.in/yaml.v3"
@@ -319,8 +320,27 @@
func
(
r
*
Runner
)
runCommands
(
tmpDir
string
,
cmds
map
[
string
]
*
cmd
.
Cmd
)
([]
string
,
error
)
{
var
compiled
[]
string
for
name
,
cmd
:=
range
cmds
{
f
,
err
:=
r
.
runCommand
(
tmpDir
,
name
,
cmd
)
if
err
!=
nil
{
return
nil
,
err
var
wg
sync
.
WaitGroup
errors
:=
make
(
chan
error
,
len
(
cmds
))
results
:=
make
(
chan
string
,
len
(
cmds
))
for
name
,
command
:=
range
cmds
{
wg
.
Add
(
1
)
go
func
(
name
string
,
c
*
cmd
.
Cmd
)
{
defer
wg
.
Done
()
f
,
err
:=
r
.
runCommand
(
tmpDir
,
name
,
c
)
if
err
!=
nil
{
errors
<-
err
}
results
<-
f
.
Name
()
}(
name
,
command
)
}
wg
.
Wait
()
select
{
case
err
:=
<-
errors
:
// return only the first error if any
return
nil
,
err
default
:
close
(
results
)
for
res
:=
range
results
{
compiled
=
append
(
compiled
,
res
)
}
@@ -326,3 +346,3 @@
}
compiled
=
append
(
compiled
,
f
.
Name
())
return
compiled
,
nil
}
@@ -328,5 +348,4 @@
}
return
compiled
,
nil
}
func
(
r
*
Runner
)
runYtt
(
tmpDir
string
,
compiled
[]
string
)
(
*
os
.
File
,
error
)
{
Loading