部署Node项目
相关脚本
cnpm install
cnpm run build
tar czf ./shell/dist.tar dist
FROM nginx:1.19.8
COPY ./nginx.conf /etc/nginx/nginx.conf
ADD ./dist.tar /usr/share/nginx/html
echo "构建镜像并且push到harbor仓库"
PROJECT_NAME='bs_manager_vue'
HARBOR_REPOSITORY_NAME='bs'
JENKINS_PROJECT_HOME=/opt/data/jenkins/jenkins_home/workspace/${PROJECT_NAME}
HARBOR_IP='192.168.1.100:99'
REPOSITORIES=${HARBOR_REPOSITORY_NAME}/${PROJECT_NAME}
HARBOR_USER='haitao'
HARBOR_USER_PASSWORD='Harbor12345'
IMAGE_ID=`docker images | grep ${
PROJECT_NAME} | awk '{print $3}'`
if [ -n "${IMAGE_ID}" ];then
docker rmi