forked from eclipse-archived/codewind-vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
97 lines (84 loc) · 2.84 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
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
#!groovy
pipeline {
agent {
kubernetes {
label 'node'
yaml """
apiVersion: v1
kind: Pod
spec:
containers:
- name: node
image: node:lts
tty: true
command:
- cat
"""
}
}
options {
timestamps()
skipStagesAfterUnstable()
}
environment {
// https://stackoverflow.com/a/43264045
HOME="."
}
stages {
stage('Build for VS Code') {
steps {
container("node") {
dir('dev') {
sh '''#!/usr/bin/env bash
# Test compilation to catch any errors
npm run vscode:prepublish
# Package for prod
npm i vsce
npx vsce package
# rename to have datetime for clarity + prevent collisions
export artifact_name=$(basename *.vsix)
mv -v $artifact_name ${artifact_name/.vsix/_$(date +'%F-%H%M').vsix}
'''
stash includes: '*.vsix', name: 'deployables'
}
}
}
}
stage("Build for Theia") {
steps {
container("node") {
dir('dev') {
sh '''#!/usr/bin/env bash
./theia-prebuild.js
# Test compilation to catch any errors
npm run vscode:prepublish
# Package for prod
npm i vsce
npx vsce package
# rename to have datetime for clarity + prevent collisions
export artifact_name=$(basename *.vsix)
mv -v $artifact_name ${artifact_name/.vsix/-theia_$(date +'%F-%H%M').vsix}
'''
stash includes: '*.vsix', name: 'deployables'
}
}
}
}
stage ("Upload") {
agent any
steps {
sshagent (['projects-storage.eclipse.org-bot-ssh']) {
unstash 'deployables'
sh '''#!/usr/bin/env bash
# ls -lA
export sshHost="genie.codewind@projects-storage.eclipse.org"
export deployDir="/home/data/httpd/download.eclipse.org/codewind/codewind-vscode/${GIT_BRANCH}/${BUILD_ID}"
ssh $sshHost mkdir -p $deployDir
scp *.vsix ${sshHost}:${deployDir}
echo "Uploaded to https://download.eclipse.org${deployDir##*download.eclipse.org}"
'''
}
}
}
}
}