-
Notifications
You must be signed in to change notification settings - Fork 4
/
Jenkinsfile
61 lines (61 loc) · 1.68 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
pipeline {
agent {label 'built-in'}
triggers {
GenericTrigger(
genericVariables: [
[key: 'ref', value: '$.ref'],
[key: 'clone_url', value: '$.repository.clone_url']
],
token: 'github123456zzzzz' ,
causeString: '$ref' ,
printContributedVariables: true,
printPostContent: true
)
}
stages {
stage('init') {
steps {
script {
TYPE = "${ref}"
}
}
}
stage('show-param') {
when {
equals expected: 'refs/heads/main',
actual: TYPE
}
steps {
echo "${ref}"
echo "${clone_url}"
}
}
stage('git-code') {
when {
equals expected: 'refs/heads/main',
actual: TYPE
}
steps {
retry(20){
echo 'install'
checkout([$class: 'GitSCM',
branches: [[name: "main"]],
doGenerateSubmoduleConfigurations: false,
extensions: [],
gitTool: 'Default',
submoduleCfg: [],
userRemoteConfigs: [[url: "${clone_url}",credentialsId: 'yunwei']]])
}
}
}
stage('restart') {
when {
equals expected: 'refs/heads/main',
actual: TYPE
}
steps {
sh'yarn && yarn build && cp -r build/* /www/wwwroot/huoxian.gin-vue-admin.com/dist/ '
}
}
}
}