-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
53 lines (51 loc) · 1.32 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
def commitId
pipeline {
environment {
SERVER_DIR = "packages/server/"
}
agent any
stages {
stage('Init') {
steps {
script {
commitId = sh (
script: 'git rev-parse HEAD',
returnStdout: true
).trim()
currentBuild.displayName = "#${BUILD_NUMBER} - ${GIT_BRANCH}"
}
}
}
stage('Install dependencies') {
steps {
echo 'Installing dependencies...'
dir(SERVER_DIR) {
sh 'yarn install'
}
}
}
stage('Test') {
steps {
echo 'Testing server...'
dir(SERVER_DIR) {
sh 'npm run test'
}
}
}
}
post {
always {
notifyBitbucket commitSha1: commitId,
considerUnstableAsSuccess: false,
credentialsId: '18464ebb-94fb-40c4-91cb-167f9e1d88ea',
disableInprogressNotification: false,
ignoreUnverifiedSSLPeer: true,
includeBuildNumberInKey: false,
prependParentProjectKey: false,
projectKey: '',
stashServerBaseUrl: 'https://bitbucket.fraunhofer.pt',
buildStatus: currentBuild.result,
buildName: currentBuild.description
}
}
}