blob: 8b07fcae4b1f96031e91135417ec7e5ed1bd5e02 [file] [log] [blame]
R. Tyler Croy5eb71412017-02-06 00:37:42 -08001#!/usr/bin/env groovy
2
R. Tyler Croyfc25da32017-02-06 02:16:17 -08003properties([
4 buildDiscarder(logRotator(numToKeepStr: '5', artifactNumToKeepStr: '5')),
5 pipelineTriggers([cron('@daily')]),
6])
7
Carlos Sancheze9f90952016-03-15 19:16:56 +01008node('docker') {
R. Tyler Croy5eb71412017-02-06 00:37:42 -08009 deleteDir()
Carlos Sancheze9f90952016-03-15 19:16:56 +010010
R. Tyler Croy5eb71412017-02-06 00:37:42 -080011 stage('Checkout') {
12 checkout scm
13 }
Carlos Sancheze9f90952016-03-15 19:16:56 +010014
R. Tyler Croy5eb71412017-02-06 00:37:42 -080015 stage('Build') {
16 docker.build('jenkins')
17 }
18
19 stage('Test') {
20 sh """
21 git submodule update --init --recursive
22 git clone https://github.com/sstephenson/bats.git
23 bats/bin/bats tests
24 """
25 }
R. Tyler Croyf358b3c2017-02-06 01:01:03 -080026
27 if (infra.isTrusted()) {
28 stage('Publish') {
Carlos Sanchez0f763d42017-02-06 10:55:11 +010029 sh './publish.sh'
R. Tyler Croyf358b3c2017-02-06 01:01:03 -080030 }
31 }
Carlos Sancheze9f90952016-03-15 19:16:56 +010032}