summaryrefslogtreecommitdiff
path: root/Jenkinsfile
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2018-12-09 23:44:12 +0100
committerChristian Poessinger <christian@poessinger.com>2018-12-18 13:37:35 +0100
commit9473364834deae2574873af9087aa8907f775b93 (patch)
treea51570622c7131b103770149a5b57fe96ecd01a9 /Jenkinsfile
parentdfbe78ffbaa225b7e11d8e1e0e0b7d65fc9e022a (diff)
downloadvyos-build-9473364834deae2574873af9087aa8907f775b93.tar.gz
vyos-build-9473364834deae2574873af9087aa8907f775b93.zip
Added Jenkinsfile
Diffstat (limited to 'Jenkinsfile')
-rw-r--r--Jenkinsfile50
1 files changed, 50 insertions, 0 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 00000000..d46fdcbf
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,50 @@
+#!/usr/bin/env groovy
+
+@NonCPS
+def setDescription() {
+ def item = Jenkins.instance.getItemByFullName(env.JOB_NAME)
+ item.setDescription("VyOS image build using a\nPipeline build inside Docker container.")
+ item.save()
+}
+
+setDescription()
+
+/* Only keep the 10 most recent builds. */
+def projectProperties = [
+ [$class: 'BuildDiscarderProperty',strategy: [$class: 'LogRotator', numToKeepStr: '5']],
+]
+
+properties(projectProperties)
+
+pipeline {
+ agent {
+ dockerfile {
+ filename 'Dockerfile'
+ label 'jessie-amd64'
+ args '--privileged'
+ }
+ }
+
+ stages {
+ stage('Configure') {
+ steps {
+ sh './configure --build-by="autobuild@vyos.net" --debian-mirror="http://ftp.us.debian.org/debian/"'
+ }
+ }
+ stage('Build ISO') {
+ steps {
+ sh 'sudo make iso'
+ }
+ }
+ }
+
+ post {
+ always {
+ echo 'One way or another, I have finished'
+ // change build dir file permissions so wen can cleanup as regular
+ // user (jenkins) afterwards
+ sh 'sudo chmod -R 777 .'
+ deleteDir() /* cleanup our workspace */
+ }
+ }
+}