-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaws.Jenkinsfile
114 lines (102 loc) · 2.95 KB
/
aws.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
pipeline {
agent {
kubernetes {
defaultContainer 'idetools'
yamlFile 'Jenkins.pod.yaml'
}
}
environment {
BUILD_VERSION = sh(returnStdout: true, script: 'gitversion').trim()
NIGHTLY_VERSION = sh(returnStdout: true, script: './tools/nightlyversion').trim()
}
options {
timeout(time: 30, unit: 'MINUTES')
}
stages {
stage('vscode') {
stages {
stage('install') {
steps {
dir('vscode') {
sh 'yarn install'
}
}
}
stage('lint') {
steps {
dir('vscode') {
sh 'yarn lint'
}
}
}
// stage("test") {
// dir("vscode") {
// steps {
// sh "yarn test"
// }
// post {
// always {
// junit "junit.xml"
// }
// }
// }
// }
stage('compile') {
steps {
dir('vscode') {
sh 'yarn compile-prod'
}
}
}
stage('build package') {
steps {
dir('vscode') {
sh "npm version ${NIGHTLY_VERSION} --allow-same-version"
sh "yarn package"
}
}
post {
success {
archiveArtifacts artifacts: "vscode/toit-${NIGHTLY_VERSION}.vsix"
}
}
}
stage('upload') {
when {
anyOf {
branch 'master'
branch pattern: "release-v\\d+.\\d+", comparator: 'REGEXP'
tag 'v*'
}
}
steps {
dir('vscode') {
withCredentials([[$class: 'FileBinding', credentialsId: 'gcloud-service-auth', variable: 'GOOGLE_APPLICATION_CREDENTIALS']]) {
sh 'gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS'
sh 'gcloud config set project infrastructure-220307'
sh "FILEEXT=vsix toitarchive toit-${NIGHTLY_VERSION}.vsix toit-archive toit-vscode $BUILD_VERSION"
}
}
}
}
stage("publish") {
when {
anyOf {
tag 'v*'
}
}
steps {
dir('vscode') {
withCredentials([string(credentialsId: 'leon-azure-access-token', variable: 'AZURE_TOKEN')]) {
sh "yarn run vsce publish --baseImagesUrl https://github.com/toitware/ide-tools/raw/master/vscode/ -p $AZURE_TOKEN $BUILD_VERSION"
}
withCredentials([string(credentialsId: 'leon-open-vsx-access-token', variable: 'OPEN_VSX_TOKEN')]) {
sh "yarn run ovsx publish --baseImagesUrl https://github.com/toitware/ide-tools/raw/master/vscode/ -p $OPEN_VSX_TOKEN toit-$BUILD_VERSION.vsix"
}
}
}
}
}
}
}
}