R. Tyler Croy | 5eb7141 | 2017-02-06 00:37:42 -0800 | [diff] [blame] | 1 | #!/usr/bin/env groovy |
2 | |||||
Carlos Sanchez | e9f9095 | 2016-03-15 19:16:56 +0100 | [diff] [blame] | 3 | node('docker') { |
R. Tyler Croy | 5eb7141 | 2017-02-06 00:37:42 -0800 | [diff] [blame] | 4 | deleteDir() |
Carlos Sanchez | e9f9095 | 2016-03-15 19:16:56 +0100 | [diff] [blame] | 5 | |
R. Tyler Croy | 5eb7141 | 2017-02-06 00:37:42 -0800 | [diff] [blame] | 6 | stage('Checkout') { |
7 | checkout scm | ||||
8 | } | ||||
Carlos Sanchez | e9f9095 | 2016-03-15 19:16:56 +0100 | [diff] [blame] | 9 | |
R. Tyler Croy | 5eb7141 | 2017-02-06 00:37:42 -0800 | [diff] [blame] | 10 | stage('Build') { |
11 | docker.build('jenkins') | ||||
12 | } | ||||
13 | |||||
14 | stage('Test') { | ||||
15 | sh """ | ||||
16 | git submodule update --init --recursive | ||||
17 | git clone https://github.com/sstephenson/bats.git | ||||
18 | bats/bin/bats tests | ||||
19 | """ | ||||
20 | } | ||||
R. Tyler Croy | f358b3c | 2017-02-06 01:01:03 -0800 | [diff] [blame] | 21 | |
22 | if (infra.isTrusted()) { | ||||
23 | stage('Publish') { | ||||
Carlos Sanchez | 0f763d4 | 2017-02-06 10:55:11 +0100 | [diff] [blame^] | 24 | sh './publish.sh' |
R. Tyler Croy | f358b3c | 2017-02-06 01:01:03 -0800 | [diff] [blame] | 25 | } |
26 | } | ||||
Carlos Sanchez | e9f9095 | 2016-03-15 19:16:56 +0100 | [diff] [blame] | 27 | } |