forked from Platform-OS/pos-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
55 lines (47 loc) · 1.23 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
@Library('pipeline-utils')_
def name = 'pos-cli'
pipeline {
agent any
environment {
PROJECT_NAME = "${env.BRANCH_NAME}-${env.GIT_COMMIT[0..5]}-${env.BUILD_ID}"
MPKIT_TOKEN = credentials('POS_TOKEN')
MPKIT_EMAIL = "[email protected]"
MPKIT_URL = "https://qa-17263.staging.oregon.platform-os.com"
}
stages {
stage('Test') {
agent { docker { image "node:12-alpine"; args '-u root' } }
steps {
sh 'npm ci'
sh 'npm test'
}
}
stage('Build') {
when { branch 'master' }
steps {
script {
docker.withRegistry('https://registry.hub.docker.com', 'posops-dockerhub') {
def image = docker.build("platformos/${name}")
image.push()
}
}
}
}
stage('Build testcafe-pos-cli') {
when { branch 'master' }
steps {
build job: 'platformOS/toolbelt/master/', parameters: [
string(name: 'force', value: 'testcafe-pos-cli')
], quietPeriod: 0
}
}
}
post {
success {
notify("${name}-pipeline ${env.PROJECT_NAME} Success after ${buildDuration()}.")
}
failure {
alert("${name}-pipeline ${env.PROJECT_NAME} Failed after ${buildDuration()}.")
}
}
}