diff --git a/README.md b/README.md index eea838d..1c3b547 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ @@ -49,4 +49,5 @@ build - 初版发布 - 完成 项目搭建 - 完成 项目迁移 从documentFrontEndWeb 到 AlipayFrontendWeb -- 增加 docker部署脚本 \ No newline at end of file +- 增加 docker部署脚本 +- 增加 环境设置脚本 \ No newline at end of file diff --git a/setup_development.sh b/setup_development.sh new file mode 100644 index 0000000..e8b4fcd --- /dev/null +++ b/setup_development.sh @@ -0,0 +1,27 @@ +### + # @Author: your name + # @Date: 2020-07-02 10:34:00 + # @LastEditTime: 2022-02-25 15:01:41 + # @LastEditors: JinxChen + # @Description: In User Settings Edit + # @FilePath: \AntpayFrontEnd\setup_development.sh +### +#!/bin/bash +npm -v +npm config set registry https://registry.npm.taobao.org +npm install +npm run build-dev +image_version=`date +%Y%m%d%H%M`; +docker stop antpay_frontend_web || true; +docker rm antpay_frontend_web || true; +# 删除镜像 +docker rmi -f $(docker images | grep telpo/antpay_frontend_web | awk '{print $3}') +# 构建telpo/mrp:$image_version镜像 +docker build --no-cache . -t telpo/antpay_frontend_web:$image_version; +#删除产生的None镜像 +docker rmi -f $(docker images | grep none | awk '{print $3}') +# 查看镜像列表 +docker images; +docker run -p 8804:80 -d --restart=always --name antpay_frontend_web telpo/antpay_frontend_web:$image_version; +# 查看日志 +docker logs antpay_frontend_web; \ No newline at end of file diff --git a/setup_production.sh b/setup_production.sh new file mode 100644 index 0000000..bb6b93d --- /dev/null +++ b/setup_production.sh @@ -0,0 +1,30 @@ +### + # @Author: your name + # @Date: 2020-07-02 10:34:59 + # @LastEditTime: 2022-02-25 15:01:53 + # @LastEditors: JinxChen + # @Description: In User Settings Edit + # @FilePath: \AntpayFrontEnd\setup_production.sh +### +#!/bin/bash +npm -v +npm config set registry https://registry.npm.taobao.org +npm install +npm run build +image_version=$version; +# 删除镜像 + docker rmi -f $(docker images | grep registry.cn-shanghai.aliyuncs.com/tolpo_platform/antpay_frontend_web | awk '{print $3}') +# 构建telpo/mrp:$image_version镜像 +docker build --no-cache . -t telpo/antpay_frontend_web:$image_version; +#TODO:推送镜像到阿里仓库 +echo '=================开始推送镜像=======================' +#docker login --username=telpo_linwl@1111649216405698 --password=telpo#1234 registry.cn-shanghai.aliyuncs.com +#docker login --username=telpo_fengjj@1111649216405698 --password=PWDaliyun123 registry.cn-shanghai.aliyuncs.com +docker login --username=rzl_wangjx@1111649216405698 --password=telpo.123 registry.cn-shanghai.aliyuncs.com +docker tag telpo/antpay_frontend_web:$image_version registry.cn-shanghai.aliyuncs.com/tolpo_platform/antpay_frontend_web:$image_version +docker push registry.cn-shanghai.aliyuncs.com/tolpo_platform/antpay_frontend_web:$image_version +echo '=================推送镜像完成=======================' +#删除产生的None镜像 +docker rmi -f $(docker images | grep none | awk '{print $3}') +# 查看镜像列表 +docker images; \ No newline at end of file diff --git a/setup_test.sh b/setup_test.sh new file mode 100644 index 0000000..2899222 --- /dev/null +++ b/setup_test.sh @@ -0,0 +1,29 @@ +### + # @Author: your name + # @Date: 2020-07-02 10:34:59 + # @LastEditTime: 2022-02-25 15:02:07 + # @LastEditors: JinxChen + # @Description: In User Settings Edit + # @FilePath: \AntpayFrontEnd\setup_test.sh +### +#!/bin/bash +npm -v +npm config set registry https://registry.npm.taobao.org +npm install +npm run build-test +image_version=$version; +# 删除镜像 +docker rmi -f $( + docker images | grep 139.224.254.18:5000/antpay_frontend_web | awk '{print $3}' +) +# 构建telpo/mrp:$image_version镜像 +docker build --no-cache . -t telpo/antpay_frontend_web:$image_version; +#TODO:推送镜像到私有仓库 +echo '=================开始推送镜像=======================' +docker tag telpo/antpay_frontend_web:$image_version 139.224.254.18:5000/antpay_frontend_web:$image_version +docker push 139.224.254.18:5000/antpay_frontend_web:$image_version +echo '=================推送镜像完成=======================' +#删除产生的None镜像 +docker rmi -f $(docker images | grep none | awk '{print $3}') +# 查看镜像列表 +docker images; \ No newline at end of file