标签:.com url root shang lse jenkins stc uil mkdir
cat Dockerfile.node.pre FROM centos MAINTAINER zhao*******h.cn ENV LANG en_US.UTF-8 RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo ‘Asia/Shanghai‘ >/etc/timezone WORKDIR /home RUN mkdir node COPY node-v8.14.0-linux-x64.tar.gz /home/ COPY pre_web /home/node/pre_web RUN tar zxf /home/node-v8.14.0-linux-x64.tar.gz -C /home/node ENV PATH PATH=$PATH:$HOME/bin:/home/node/node-v8.14.0-linux-x64/bin RUN npm install pm2 -g WORKDIR /home/node/pre_web EXPOSE 3000 ENTRYPOINT npm i && npm run pm2 && tail -f /root/.pm2/logs/npm-out.log
cat pre_node_weifengtech_build.sh
#!/bin/bash
source /etc/profile
cd /mnt/workspace/official-ui-node-pre/
rm -rf /mnt/workspace/official-ui-node-pre/dockerfile/pre_web
cd /mnt/workspace/official-ui-node-pre/
mkdir -p ./dockerfile/pre_web
cp -r next.config.js package.json package-lock.json pages postcss.config.js static ./dockerfile/pre_web
cd ./dockerfile
sudo docker build -t official-ui-node-pre -f Dockerfile.node.pre .
sudo docker login --username=***** -p ********* registry-vpc.cn-hangzhou.aliyuncs.com
sudo docker tag official-ui-node-pre registry-vpc.cn-hangzhou.aliyuncs.com/weifeng-system/official-ui-node-pre
sudo docker push registry-vpc.cn-hangzhou.aliyuncs.com/weifeng-system/official-ui-node-pre
curl https://cs.console.aliyun.com/hook/trigger*********mw7gFBJyybsmrrtuEo5dEjsm6qtB7qM60pHQD8
if [ $? -eq 0 ]; then
echo -e "\033[32m[ the application official-ui-node-pre successfully deployed ]\033[0m"
else
echo -e "\033[31m\033[01m[ the application official-ui-node-pre deploy failed ]\033[0m"
fi
Dockerfile 构建前端node应用并用shell脚本实现jenkins自动构建
标签:.com url root shang lse jenkins stc uil mkdir
原文地址:https://www.cnblogs.com/weifeng1463/p/10265623.html