feat: add gitlab-ci.yml
This commit is contained in:
44
.gitlab-ci.yml
Normal file
44
.gitlab-ci.yml
Normal file
@@ -0,0 +1,44 @@
|
||||
stages:
|
||||
- build_project
|
||||
- build_image
|
||||
|
||||
cache:
|
||||
key:
|
||||
files:
|
||||
- package.json
|
||||
paths:
|
||||
- node_modules
|
||||
|
||||
before_script:
|
||||
- export CNUI_TAG=$(date +%Y%m%d%H%M%S)
|
||||
|
||||
build_project:
|
||||
stage: build_project
|
||||
script:
|
||||
- echo "npm install ..."
|
||||
- npm install --unsafe-perm
|
||||
- echo "npm run build"
|
||||
- npm run build
|
||||
artifacts:
|
||||
paths:
|
||||
- dist
|
||||
only:
|
||||
- dev
|
||||
tags:
|
||||
- GN-XXG-Server
|
||||
|
||||
build_image:
|
||||
stage: build_image
|
||||
script:
|
||||
- echo "docker build"
|
||||
- sudo docker build -t dev_cn-ui:$CNUI_TAG .
|
||||
- echo "docker tag"
|
||||
- sudo docker tag dev_cn-ui:$CNUI_TAG 192.168.40.153:9080/cyber-narrator/dev_cn-ui:$CNUI_TAG
|
||||
- echo "docker push"
|
||||
- sudo docker push 192.168.40.153:9080/cyber-narrator/dev_cn-ui:$CNUI_TAG
|
||||
when: on_success
|
||||
only:
|
||||
- dev
|
||||
tags:
|
||||
- GN-XXG-Server
|
||||
|
||||
9
Dockerfile
Normal file
9
Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
||||
FROM nginx:latest
|
||||
|
||||
MAINTAINER shizhendong shizhendong@zdjizhi.com
|
||||
|
||||
# 将dist文件中的内容复制到 /usr/share/nginx/html/ 这个目录下面
|
||||
COPY dist/ /usr/share/nginx/html/
|
||||
|
||||
# nginx 配置 , 制作镜像时不做处理 , 容器可自己挂载配置文件
|
||||
#COPY nginx.conf /etc/nginx/nginx.conf
|
||||
Reference in New Issue
Block a user