1 Star 0 Fork 37

shech/twelvet-ui-react

forked from twelvet/twelvet-ui 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Jenkinsfile 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
twelvet 提交于 2021-09-16 14:44 . jenkinfile
pipeline {
agent any
tools {
yarn 'yarn'
}
parameters {
choice(
description: '是否安装依赖?',
name: 'isInstall',
choices: ['false', 'true']
)
}
stages {
stage('install twelvet-react-ui') {
when {
expression { isInstall ==~ /(true)/ }
}
steps {
dir('twelvet-react-ui') {
sh 'node -v'
sh 'npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass'
sh 'npm cache clean --force'
sh 'npm install -g yarn --unsafe-perm'
}
}
}
stage('Build twelvet-react-ui') {
steps {
dir('twelvet-react-ui') {
sh 'rm -rf node_modules'
sh 'rm -rf package-lock.json'
sh 'rm -rf dist'
sh 'yarn build'
dir('dist') {
sh(script: 'tar cvzf twelvet-react-ui.tar.gz .', returnStatus: true)
archiveArtifacts artifacts: '**/*.tar.gz', fingerprint: true
}
}
}
}
}
}
node {
if (env.BRANCH_NAME.contains('dev')) {
def remote = [:]
remote.name = 'twelvet'
remote.host = env.REMOTE_HOST
withCredentials([usernamePassword(credentialsId: 'twelvet', passwordVariable: 'password', usernameVariable: 'userName')]) {
remote.user = userName
remote.password = password
remote.allowAnyHosts = true
stage('push to twelvet-react-ui') {
sshPut remote: remote, from: 'twelvet-react-ui/dist/twelvet-react-ui.tar.gz', into: '/data/docker/nginx/html/twelvet/.'
sshCommand remote: remote, command: 'tar xvzf /data/docker/nginx/html/twelvet/vue-shh-admin-ui.tar.gz -C /data/docker/nginx/html/twelvet'
}
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/swantb/twelvet-ui-react.git
git@gitee.com:swantb/twelvet-ui-react.git
swantb
twelvet-ui-react
twelvet-ui-react
master

搜索帮助