forked from taiidani/terraform-provider-jenkins
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
46 lines (45 loc) · 1.15 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env groovy
pipeline {
agent {
label 'os:linux && terraform'
}
options {
skipDefaultCheckout()
disableConcurrentBuilds()
ansiColor('xterm')
}
parameters {
string(name: 'RELEASE_VERSION',
defaultValue: '',
description: 'The version of the terraform provider. (MAJOR.MINOR.PATCH, e.g. 0.0.1). If the version is left empty, release stage will be skipped.',
trim:true)
}
stages {
stage("Checkout") {
steps {
checkout scm
}
}
stage("Build") {
when {
expression {
params.RELEASE_VERSION == ''
}
}
steps {
goreleaser snapshot: true
archiveArtifacts artifacts: 'dist/*.zip', fingerprint: true
}
}
stage("Release") {
when {
expression {
params.RELEASE_VERSION != ''
}
}
steps {
goreleaser releaseVersion: params.RELEASE_VERSION
}
}
}
}