R. Tyler Croy | 5eb7141 | 2017-02-06 00:37:42 -0800 | [diff] [blame] | 1 | #!/usr/bin/env groovy |
2 | |||||
R. Tyler Croy | fc25da3 | 2017-02-06 02:16:17 -0800 | [diff] [blame] | 3 | properties([ |
4 | buildDiscarder(logRotator(numToKeepStr: '5', artifactNumToKeepStr: '5')), | ||||
5 | pipelineTriggers([cron('@daily')]), | ||||
6 | ]) | ||||
7 | |||||
Carlos Sanchez | e9f9095 | 2016-03-15 19:16:56 +0100 | [diff] [blame] | 8 | node('docker') { |
R. Tyler Croy | 5eb7141 | 2017-02-06 00:37:42 -0800 | [diff] [blame] | 9 | deleteDir() |
Carlos Sanchez | e9f9095 | 2016-03-15 19:16:56 +0100 | [diff] [blame] | 10 | |
R. Tyler Croy | 5eb7141 | 2017-02-06 00:37:42 -0800 | [diff] [blame] | 11 | stage('Checkout') { |
12 | checkout scm | ||||
13 | } | ||||
Carlos Sanchez | e9f9095 | 2016-03-15 19:16:56 +0100 | [diff] [blame] | 14 | |
R. Tyler Croy | 5eb7141 | 2017-02-06 00:37:42 -0800 | [diff] [blame] | 15 | 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 Croy | f358b3c | 2017-02-06 01:01:03 -0800 | [diff] [blame] | 26 | |
27 | if (infra.isTrusted()) { | ||||
28 | stage('Publish') { | ||||
Carlos Sanchez | 0f763d4 | 2017-02-06 10:55:11 +0100 | [diff] [blame] | 29 | sh './publish.sh' |
R. Tyler Croy | f358b3c | 2017-02-06 01:01:03 -0800 | [diff] [blame] | 30 | } |
31 | } | ||||
Carlos Sanchez | e9f9095 | 2016-03-15 19:16:56 +0100 | [diff] [blame] | 32 | } |