-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
39 lines (33 loc) · 1.04 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 'jenkins-master'
}
}
environment {
NODEJS_HOME = "${tool 'NodeJS-12.18.3'}"
PATH="${env.NODEJS_HOME}/bin:${env.PATH}"
}
tools {
nodejs "NodeJS-12.18.3" //这里是全局工具配置的名字,要对应
}
stages {
stage('checkout-source') {
steps {
git credentialsId: 'gitlab-project-auth',
url: 'https://github.com/jiangxiaoqiang/xiaoqiang-blog-source.git'
}
}
stage('build-source') {
steps{
sh "npm install --no-optional"
sh "npm install yarn"
sh "npm install -g [email protected] [email protected]"
sh "hexo clean"
sh "hexo generate"
sh "rm -rf ${JENKINS_HOME}/workspace/jiangxiaoqiang.github.io/2020"
sh "cp -r jiangxiaoqiang.github.io/* ${JENKINS_HOME}/workspace/jiangxiaoqiang.github.io"
}
}
}
}