Skip to content

Commit

Permalink
Add arm build lock to avoid parallel arm builds on one Jenkins node (s…
Browse files Browse the repository at this point in the history
…onic-net#213)

* Add arm build lock to avoid parallel arm builds on one Jenkins node

Co-authored-by: Xianghong Gu <xgu@centecnetworks.com>
  • Loading branch information
guxianghong and Xianghong Gu authored Jan 10, 2021
1 parent 83f3a1f commit 2a36727
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pipeline {

stage('Build') {
steps {
lock(resource: "arm_build_${env.NODE_NAME}") {
sh '''#!/bin/bash -xe
git submodule foreach --recursive '[ -f .git ] && echo "gitdir: $(realpath --relative-to=. $(cut -d" " -f2 .git))" > .git'
export DOCKER_DATA_ROOT_FOR_MULTIARCH=/data/march/docker
Expand All @@ -46,7 +47,8 @@ pipeline {
pid=`sudo cat dockerfs/var/run/docker.pid` ; sudo kill $pid
fi
sudo rm -rf ${DOCKER_DATA_ROOT_FOR_MULTIARCH}
'''
'''
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion jenkins/centec-arm64/buildimage-centec-arm64-all/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pipeline {

stage('Build') {
steps {
lock(resource: "arm_build_${env.NODE_NAME}") {
sh '''#!/bin/bash -xe
git submodule foreach --recursive '[ -f .git ] && echo "gitdir: $(realpath --relative-to=. $(cut -d" " -f2 .git))" > .git'
export DOCKER_DATA_ROOT_FOR_MULTIARCH=/data/march/docker
Expand All @@ -46,7 +47,8 @@ pipeline {
pid=`sudo cat dockerfs/var/run/docker.pid` ; sudo kill $pid
fi
sudo rm -rf ${DOCKER_DATA_ROOT_FOR_MULTIARCH}
'''
'''
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pipeline {

stage('Build') {
steps {
lock(resource: "arm_build_${env.NODE_NAME}") {
sh '''#!/bin/bash -xe
git submodule foreach --recursive '[ -f .git ] && echo "gitdir: $(realpath --relative-to=. $(cut -d" " -f2 .git))" > .git'
Expand All @@ -53,6 +54,7 @@ if sudo [ -f dockerfs/var/run/docker.pid ] ; then
fi
sudo rm -rf ${DOCKER_DATA_ROOT_FOR_MULTIARCH}
'''
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions jenkins/marvell-armhf/buildimage-mrvl-armhf-all/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pipeline {

stage('Build') {
steps {
lock(resource: "arm_build_${env.NODE_NAME}") {
sh '''#!/bin/bash -xe
git submodule foreach --recursive '[ -f .git ] && echo "gitdir: $(realpath --relative-to=. $(cut -d" " -f2 .git))" > .git'
Expand All @@ -53,6 +54,7 @@ if sudo [ -f dockerfs/var/run/docker.pid ] ; then
fi
sudo rm -rf ${DOCKER_DATA_ROOT_FOR_MULTIARCH}
'''
}
}
}

Expand Down

0 comments on commit 2a36727

Please sign in to comment.