summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-12-27 15:59:51 +0100
committerChristian Poessinger <christian@poessinger.com>2019-12-27 15:59:51 +0100
commit79c4587b5cf21b9e5601d91962708d53bf2ec417 (patch)
treeb9d4abb6321b591f60002d17e4961c4b01768ba3
parentd2782a22b2901ecee9a3e5d61a17179a2d5d8ce4 (diff)
downloadvyos-opennhrp-79c4587b5cf21b9e5601d91962708d53bf2ec417.tar.gz
vyos-opennhrp-79c4587b5cf21b9e5601d91962708d53bf2ec417.zip
Jenkins: make pipeline branch independent
-rw-r--r--Jenkinsfile27
1 files changed, 23 insertions, 4 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index 3b8daeb..ed98477 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
}
}
@@ -121,8 +134,15 @@ pipeline {
sshagent(['SSH-dev.packages.vyos.net']) {
// build up some fancy groovy variables so we do not need to write/copy
// every option over and over again!
+ def RELEASE = getGitBranchName()
+ if (getGitBranchName() == "master") {
+ RELEASE = 'current'
+ }
+
+ def VYOS_REPO_PATH = '/home/sentrium/web/dev.packages.vyos.net/public_html/repositories/' + RELEASE + '/'
+ if (getGitBranchName() == "crux")
+ VYOS_REPO_PATH += 'vyos/'
- def VYOS_REPO_PATH = '/home/sentrium/web/dev.packages.vyos.net/public_html/repositories/' + getGitBranchName() + '/'
def SSH_OPTS = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR'
def SSH_REMOTE = 'khagen@10.217.48.113'
@@ -130,7 +150,6 @@ pipeline {
files = findFiles(glob: '*.deb')
files.each { PACKAGE ->
- def RELEASE = getGitBranchName()
def ARCH = sh(returnStdout: true, script: "dpkg-deb -f ${PACKAGE} Architecture").trim()
def SUBSTRING = sh(returnStdout: true, script: "dpkg-deb -f ${PACKAGE} Package").trim()
def SSH_DIR = '~/VyOS/' + RELEASE + '/' + ARCH