forked from metersphere/metersphere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
39 lines (39 loc) · 1.39 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
pipeline {
agent {
node {
label 'metersphere'
}
}
options { quietPeriod(600) }
environment {
IMAGE_NAME = 'metersphere'
IMAGE_PREFIX = 'registry.cn-qingdao.aliyuncs.com/metersphere'
}
stages {
stage('Build/Test') {
steps {
configFileProvider([configFile(fileId: 'metersphere-maven', targetLocation: 'settings.xml')]) {
sh "cd frontend"
sh "yarn install"
sh "cd .."
sh "mvn clean package --settings ./settings.xml"
}
}
}
stage('Docker build & push') {
steps {
sh "docker build --build-arg MS_VERSION=\${TAG_NAME:-\$BRANCH_NAME}-\${GIT_COMMIT:0:8} -t ${IMAGE_NAME}:\${TAG_NAME:-\$BRANCH_NAME} ."
sh "docker tag ${IMAGE_NAME}:\${TAG_NAME:-\$BRANCH_NAME} ${IMAGE_PREFIX}/${IMAGE_NAME}:\${TAG_NAME:-\$BRANCH_NAME}"
sh "docker push ${IMAGE_PREFIX}/${IMAGE_NAME}:\${TAG_NAME:-\$BRANCH_NAME}"
}
}
}
post('Notification') {
always {
sh "echo \$WEBHOOK\n"
withCredentials([string(credentialsId: 'wechat-bot-webhook', variable: 'WEBHOOK')]) {
qyWechatNotification failSend: true, mentionedId: '', mentionedMobile: '', webhookUrl: "$WEBHOOK"
}
}
}
}