Skip to content

Commit

Permalink
Merge pull request #58 from laszlocph/fix-sequence
Browse files Browse the repository at this point in the history
After filterItemsWithMissingDependencies introduced, the next id can …
  • Loading branch information
laszlocph authored Jul 23, 2019
2 parents 063b7fc + 1f83f0f commit 9b069dd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions server/procBuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,23 +248,26 @@ func (b *procBuilder) toInternalRepresentation(parsed *yaml.Config, environ map[
}

func setBuildStepsOnBuild(build *model.Build, buildItems []*buildItem) *model.Build {
var pidSequence int
for _, item := range buildItems {
build.Procs = append(build.Procs, item.Proc)
if pidSequence < item.Proc.PID {
pidSequence = item.Proc.PID
}
}
pcounter := len(build.Procs)

for _, item := range buildItems {
for _, stage := range item.Config.Stages {
var gid int
for _, step := range stage.Steps {
pcounter++
pidSequence++
if gid == 0 {
gid = pcounter
gid = pidSequence
}
proc := &model.Proc{
BuildID: build.ID,
Name: step.Alias,
PID: pcounter,
PID: pidSequence,
PPID: item.Proc.PID,
PGID: gid,
State: model.StatusPending,
Expand Down

0 comments on commit 9b069dd

Please sign in to comment.