summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-12-28 09:43:58 +0100
committerChristian Poessinger <christian@poessinger.com>2019-12-28 09:45:07 +0100
commit1553a4f693729b1ecbd38b3256fc05ac456092b2 (patch)
tree808af5025a7d278b458f1cbacdb5a6a7ec024706
parentae2c359c2938466001359823d4b2a97bd360a889 (diff)
downloadvyos-1x-1553a4f693729b1ecbd38b3256fc05ac456092b2.tar.gz
vyos-1x-1553a4f693729b1ecbd38b3256fc05ac456092b2.zip
Jenkins: make pipeline branch independent
-rw-r--r--Jenkinsfile20
1 files changed, 18 insertions, 2 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index 63a271bc1..ed98477f2 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -69,11 +69,24 @@ def projectProperties = [
properties(projectProperties)
setDescription()
+node('Docker') {
+ stage('Define Agent') {
+ script {
+ // create container name on demand
+ def branchName = getGitBranchName()
+ if (branchName == "master") {
+ branchName = "current"
+ }
+ env.DOCKER_IMAGE = "vyos/vyos-build:" + branchName
+ }
+ }
+}
+
pipeline {
agent {
docker {
- args '--sysctl net.ipv6.conf.lo.disable_ipv6=0 -e GOSU_UID=1006 -e GOSU_GID=1006'
- image 'vyos/vyos-build:current'
+ args "--sysctl net.ipv6.conf.lo.disable_ipv6=0 -e GOSU_UID=1006 -e GOSU_GID=1006"
+ image "${env.DOCKER_IMAGE}"
alwaysPull true
}
}
@@ -127,6 +140,9 @@ pipeline {
}
def VYOS_REPO_PATH = '/home/sentrium/web/dev.packages.vyos.net/public_html/repositories/' + RELEASE + '/'
+ if (getGitBranchName() == "crux")
+ VYOS_REPO_PATH += 'vyos/'
+
def SSH_OPTS = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR'
def SSH_REMOTE = 'khagen@10.217.48.113'