summaryrefslogtreecommitdiff
path: root/Jenkinsfile
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-10-06 11:36:09 +0200
committerChristian Poessinger <christian@poessinger.com>2019-10-06 11:36:09 +0200
commitaca46a9270bba6bcb50cedbbeafaf1279ab8c82b (patch)
tree1c669fb6e58a3af765632abbc8337e0db45030e3 /Jenkinsfile
parent173aaa25b60efa45b402b68f9b193cf9f83b3746 (diff)
parent45a9ea3c32183c0b0e7bbcabbe41dbe8d6337744 (diff)
downloadvyos-build-aca46a9270bba6bcb50cedbbeafaf1279ab8c82b.tar.gz
vyos-build-aca46a9270bba6bcb50cedbbeafaf1279ab8c82b.zip
Merge branch 'current' into equuleus
* current: Jenkins: add getGitRepoName() Docker: ARM: add missing no--check-valid-until files Kernel: T1708: update to Linux 4.19.76 Jenkins: explicitly set GitHub status is no longer required Docker: we only need LUA 5.2 for Accel-PPP build Docker: add liblua5.2-dev to accel-ppp dependencies [Jenkinsfile] Call a script that creates latest rolling release symlink Jenkins: run on all nodes that support Docker Packages: remove vyatta-op-dhcp-server Docker: add dkms Add helper to list individual package architectues add hooks for autobuild
Diffstat (limited to 'Jenkinsfile')
-rw-r--r--Jenkinsfile48
1 files changed, 13 insertions, 35 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index fcf0dafd..e2077bc4 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -25,11 +25,17 @@ def getGitRepoURL() {
return scm.userRemoteConfigs[0].url
}
-// Returns true if this is a custom build launched on any project fork,
-// returns false if this is build from git@github.com:vyos/vyos-build.git
+def getGitRepoName() {
+ return getGitRepoURL().split('/').last()
+}
+
+// Returns true if this is a custom build launched on any project fork.
+// Returns false if this is build from git@github.com:vyos/<reponame>.
+// <reponame> can be e.g. vyos-1x.git or vyatta-op.git
def isCustomBuild() {
- def gitURI = "git@github.com:vyos/vyos-build.git"
- def httpURI = "https://github.com/vyos/vyos-build.git"
+ // GitHub organisation base URL
+ def gitURI = 'git@github.com:vyos/' + getGitRepoName()
+ def httpURI = 'https://github.com/vyos/' + getGitRepoName()
return ! ((getGitRepoURL() == gitURI) || (getGitRepoURL() == httpURI))
}
@@ -56,24 +62,6 @@ def setDescription() {
item.save()
}
-def setGitHubStatus(state, description) {
- if (isCustomBuild())
- return
-
- withCredentials([string(credentialsId: 'GitHub-API-Token', variable: 'TOKEN')]) {
- def commitId = sh(returnStdout: true, script: "git rev-parse HEAD").trim()
- def postBody = [
- state: "${state}",
- target_url: "${BUILD_URL}",
- description: "${description}",
- context: 'continuous-integration/jenkins',
- ]
- def postBodyString = groovy.json.JsonOutput.toJson(postBody)
- sh "curl 'https://api.github.com/repos/vyos/vyos-build/statuses/${commitId}?access_token=${TOKEN}' \
- -H 'Content-Type: application/json' -X POST -d '${postBodyString}' -k"
- }
-}
-
/* Only keep the 10 most recent builds. */
def projectProperties = [
[$class: 'BuildDiscarderProperty',strategy: [$class: 'LogRotator', numToKeepStr: '1']],
@@ -94,7 +82,6 @@ pipeline {
agent {
dockerfile {
filename 'Dockerfile'
- label 'jessie-amd64'
dir 'docker'
args '--privileged --sysctl net.ipv6.conf.lo.disable_ipv6=0 -e GOSU_UID=1006 -e GOSU_GID=1006'
}
@@ -103,7 +90,6 @@ pipeline {
stage('Configure') {
steps {
script {
- setGitHubStatus("pending", "Build is pending.")
sh """
./configure --build-by="autobuild@vyos.net" --debian-mirror="http://ftp.us.debian.org/debian/"
"""
@@ -156,18 +142,10 @@ pipeline {
sh """
scp ${SSH_OPTS} build/vyos*.iso ${SSH_REMOTE}:${SSH_DIR}/
"""
+ sh """
+ ssh ${SSH_OPTS} ${SSH_REMOTE} -t "bash --login -c '/usr/bin/make-latest-rolling-symlink.sh'"
+ """
}
-
- setGitHubStatus("success", "Build has succeeded!")
- }
- }
- failure {
- script {
- // only deploy ISO if build from official repository
- if (isCustomBuild())
- return
-
- setGitHubStatus("failure", "Build has failed!")
}
}
cleanup {