summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-12-27 15:34:03 +0100
committerChristian Poessinger <christian@poessinger.com>2019-12-27 15:34:03 +0100
commit03c6dd6be4d63b818df0a3b60b13230d944843b7 (patch)
tree34886659e047d36f5f417309dae57cdf991d5f06
parent0c08e0b3e14411ff2d9cfff57452d167310b86c7 (diff)
downloadlibvyosconfig-03c6dd6be4d63b818df0a3b60b13230d944843b7.tar.gz
libvyosconfig-03c6dd6be4d63b818df0a3b60b13230d944843b7.zip
Jenkins: make pipeline branch independent
-rw-r--r--Jenkinsfile17
1 files changed, 15 insertions, 2 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index 1dc3556..af31df0 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -69,11 +69,20 @@ def projectProperties = [
properties(projectProperties)
setDescription()
+node('Docker') {
+ stage('Define Agent') {
+ script {
+ // create container name on demand
+ env.DOCKER_IMAGE = "vyos/vyos-build:" + getGitBranchName()
+ }
+ }
+}
+
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
}
}
@@ -100,6 +109,7 @@ pipeline {
dir('build') {
def commitId = sh(returnStdout: true, script: 'git rev-parse --short=11 HEAD').trim()
currentBuild.description = sprintf('Git SHA1: %s', commitId[-11..-1])
+
sh 'eval $(opam env --root=/opt/opam --set-root) && dpkg-buildpackage -b -us -uc -tc'
}
}
@@ -126,6 +136,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'