forked from crossplane/crossplane
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.tag
42 lines (35 loc) · 1.39 KB
/
Jenkinsfile.tag
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
pipeline {
agent { label 'upbound-gce' }
parameters {
string(name: 'version', defaultValue: '', description: 'The version you are releasing, for example v0.4.0')
string(name: 'commit', defaultValue: '', description: 'Optional commit hash for this release, for example 56b65dba917e50132b0a540ae6ff4c5bbfda2db6. If empty the latest commit hash will be used.')
}
options {
disableConcurrentBuilds()
timestamps()
}
environment {
GITHUB_UPBOUND_BOT = credentials('github-upbound-jenkins')
}
stages {
stage('Prepare') {
steps {
// github credentials are not setup to push over https in jenkins. add the github token to the url
sh "git config remote.origin.url https://${GITHUB_UPBOUND_BOT_USR}:${GITHUB_UPBOUND_BOT_PSW}@\$(git config --get remote.origin.url | sed -e 's/https:\\/\\///')"
sh 'git config user.name "upbound-bot"'
sh 'git config user.email "info@crossplane.io"'
sh 'echo "machine github.com login upbound-bot password $GITHUB_UPBOUND_BOT" > ~/.netrc'
}
}
stage('Tag Release') {
steps {
sh "./build/run make -j\$(nproc) tag VERSION=${params.version} COMMIT_HASH=${params.commit}"
}
}
}
post {
always {
deleteDir()
}
}
}