更新main.js, Dockerfile, .gitlab-ci.yml
This commit is contained in:
parent
bdf6292c1b
commit
71567d2ca1
46
.gitlab-ci.yml
Normal file
46
.gitlab-ci.yml
Normal file
@ -0,0 +1,46 @@
|
||||
variables:
|
||||
APP_NAME: "qingting"
|
||||
IMAGE_NAME: "$APP_NAME:$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
|
||||
DOCKER_FILE_PATH: "./Dockerfile"
|
||||
|
||||
|
||||
stages:
|
||||
- build
|
||||
- clear
|
||||
- deploy
|
||||
- purge
|
||||
|
||||
build:
|
||||
stage: build
|
||||
image: docker:latest
|
||||
services:
|
||||
- name: docker:dind
|
||||
tags:
|
||||
- dockerbase
|
||||
script:
|
||||
- ls -a
|
||||
- docker build -t ${IMAGE_NAME} -f ${DOCKER_FILE_PATH} .
|
||||
|
||||
clear:
|
||||
stage: clear
|
||||
tags:
|
||||
- dockerbase
|
||||
script:
|
||||
- docker stop ${APP_NAME}
|
||||
- docker rm ${APP_NAME}
|
||||
allow_failure: true
|
||||
|
||||
deploy:
|
||||
stage: deploy
|
||||
tags:
|
||||
- dockerbase
|
||||
script:
|
||||
- ls -a
|
||||
- docker run -d --name ${APP_NAME} -p 5013:80 ${IMAGE_NAME}
|
||||
|
||||
purge:
|
||||
stage: purge
|
||||
tags:
|
||||
- dockerbase
|
||||
script:
|
||||
- docker run --rm dns:blog
|
@ -9,4 +9,4 @@ WORKDIR /app
|
||||
#安装依赖
|
||||
RUN npm install
|
||||
#程序启动脚本
|
||||
CMD ["npm", "start"]
|
||||
CMD ["npm", "start"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user