Commit 689b2f54 authored by 郭铭瑶's avatar 郭铭瑶 🤘

打包

parent d2fc7f9e
#!/usr/bin/groovy
@Library('pipeline-library')
def utils = new io.fabric8.Utils()
clientsNode{
def env = 'shanghaiwuye'
def projectName = "${JOB_BASE_NAME}"
def newVersion = ''
def deployType = ""
try {
deployType = DEPLOY_TYPE
} catch (Throwable e) {
deployType = "TEST"
}
checkout scm
stage '构建版本'
echo 'NOTE: running pipelines for the first time will take longer as build and base docker images are pulled onto the node'
if (!fileExists ('Dockerfile')) {
writeFile file: 'Dockerfile', text: '''FROM 168.168.112.64:5000/node-nginx:8.12.0
WORKDIR /app
# 将当前目录下的所有文件拷贝到工作目录下
COPY . /app/
# 1.安装依赖
# 2.运行 npm run build
# 3.将 dist 目录的所有文件拷贝到 nginx 的目录下
# 4.删除工作目录的文件,尤其是 node_modules 以减小镜像体积
# 由于镜像构建的每一步都会产生新层
# 为了减小镜像体积,尽可能将一些同类操作,集成到一个步骤中,如下、
RUN cp -r dist/* /var/www/html \\
'''
}
newVersion = performCanaryRelease {}
def rc = getKubernetesJson {
port = 80
label = 'nodejs'
version = newVersion
name = projectName
imageName = clusterImageName
}
stage '部署'
kubernetesApply(file: rc, environment: env)
}
let BASE_URL = '' let BASE_URL = ''
switch (process.env.NODE_ENV) { switch (process.env.NODE_ENV) {
case 'production': case 'production':
BASE_URL = 'product_url' BASE_URL = 'http://www.962121.net/hmfmstest/shanghaiwuye/propertyinspector/api/v1'
break break
default: default:
// BASE_URL = 'http://yapi.omniview.pro/mock/54/propertyinspector/api/v1/' // BASE_URL = 'http://yapi.omniview.pro/mock/54/propertyinspector/api/v1/'
...@@ -9,8 +9,6 @@ default: ...@@ -9,8 +9,6 @@ default:
}; };
export default { export default {
BASE_URL, BASE_URL,
TEST_URL: '/api/test_url',
POST_CHECKCOMMUNITY_LIST:'sharingplatform/sectListForOneDay', //物业督查---每一个主题下某天已检查的小区列表 POST_CHECKCOMMUNITY_LIST:'sharingplatform/sectListForOneDay', //物业督查---每一个主题下某天已检查的小区列表
POST_CHECKPEOPLE_LIST:'sharingplatform/getInspectors', // 检查人员列表 POST_CHECKPEOPLE_LIST:'sharingplatform/getInspectors', // 检查人员列表
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment