Skip to content

Commit bb60d9c

Browse files
committed
add Jenkinsfile
1 parent 8f92884 commit bb60d9c

3 files changed

Lines changed: 125 additions & 2 deletions

File tree

Jenkinsfile

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
pipeline
2+
{
3+
agent
4+
{
5+
kubernetes
6+
{
7+
containerTemplate
8+
{
9+
name 'kiso-build-env'
10+
image 'eclipse/kiso-build-env:v0.1.1'
11+
alwaysPullImage 'true'
12+
ttyEnabled true
13+
resourceRequestCpu '2'
14+
resourceLimitCpu '2'
15+
resourceRequestMemory '8Gi'
16+
resourceLimitMemory '8Gi'
17+
}
18+
}
19+
}
20+
stages
21+
{
22+
stage('Setup Env')
23+
{
24+
steps
25+
{
26+
// Clean workspace
27+
cleanWs()
28+
checkout scm
29+
}
30+
}
31+
32+
stage('Run unittests')
33+
{
34+
steps
35+
{
36+
sh """
37+
npm install
38+
xvfb-run -a npm run test
39+
"""
40+
}
41+
}
42+
43+
stage('build plugin')
44+
{
45+
steps
46+
{
47+
sh """
48+
npm install
49+
vsce package --baseContentUrl https://github.com/eclipse/kiso-testing-vscode.git
50+
"""
51+
52+
}
53+
}
54+
55+
stage('publish')
56+
{
57+
when
58+
{
59+
buildingTag()
60+
}
61+
steps
62+
{
63+
withCredentials([string(
64+
credentialsId: 'vscode-marketplace-token',
65+
variable: 'token')]) {
66+
67+
sh """
68+
export VSCE_PAT=${token}
69+
vsce publish --baseContentUrl https://github.com/eclipse/kiso-testing-vscode.git
70+
"""
71+
}
72+
}
73+
}
74+
75+
76+
} // stages
77+
78+
post // Called at very end of the script to notify developer and github about the result of the build
79+
{
80+
// always
81+
// {
82+
// // pass
83+
// }
84+
success
85+
{
86+
cleanWs()
87+
}
88+
unstable
89+
{
90+
notifyFailed()
91+
}
92+
failure
93+
{
94+
notifyFailed()
95+
}
96+
aborted
97+
{
98+
notifyAbort()
99+
}
100+
}
101+
} // pipeline
102+
103+
104+
def notifyFailed()
105+
{
106+
emailext (subject: "Job '${env.JOB_NAME}' (${env.BUILD_NUMBER}) is failing",
107+
body: "Oups, something went wrong with ${env.BUILD_URL}... We are looking forward for your fix!",
108+
recipientProviders: [[$class: 'CulpritsRecipientProvider'],
109+
[$class: 'DevelopersRecipientProvider'],
110+
[$class: 'RequesterRecipientProvider']])
111+
}
112+
113+
def notifyAbort()
114+
{
115+
emailext (subject: "Job '${env.JOB_NAME}' (${env.BUILD_NUMBER}) was aborted",
116+
body: "Oups, something went wrong with ${env.BUILD_URL}... We are looking forward for your fix!",
117+
recipientProviders: [[$class: 'CulpritsRecipientProvider'],
118+
[$class: 'DevelopersRecipientProvider'],
119+
[$class: 'RequesterRecipientProvider']])
120+
}

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "pykiso-runner",
33
"displayName": "pykiso-runner",
44
"description": "run pykiso yaml files",
5-
"publisher": "automation-team",
5+
"publisher": "eclipse-kiso-testing",
66
"version": "0.1.0",
77
"engines": {
88
"vscode": "^1.54.0"
@@ -190,5 +190,7 @@
190190
"dependencies": {
191191
"@types/js-yaml": "^4.0.4",
192192
"js-yaml": "^4.1.0"
193-
}
193+
},
194+
"author": "",
195+
"license": "ISC"
194196
}

0 commit comments

Comments
 (0)