Commit e2cb89e3 authored by 熊成伟's avatar 熊成伟
parents 8e10f9fb 651071bd
Pipeline #15196 failed with stages
in 48 seconds
# This file is a template, and might need editing before it works on your project.
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
#services:
# - docker:dind
variables:
KUBECONFIG: /etc/deploy/config
##This folder is cached between builds
##http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
untracked: true
paths:
- ./node_modules
stages:
- build
- push
- deploy
build-node-dev:
image: node:11.2.0
stage: build
before_script:
- npm config set registry=http://registry.npm.taobao.org
- npm config set puppeteer_download_host=https://storage.googleapis.com.cnpmjs.org
- export APP_ENV_OS=dev
script:
- npm i
- npm run build
only:
- dev
tags:
- node-build-mac
#- svr251
cache:
paths:
- ./dist
docker-push-dev:
image: docker:stable
stage: push
# services:
# - docker:dind
# variables:
# DOCKER_HOST: tcp://localhost:2375
# DOCKER_DRIVER: overlay2
script:
- ls -al
- find ./ -name dist
- docker build -t registry.cn-shenzhen.aliyuncs.com/thinker-vc/communicaten-web:1.0.0 .
- docker push registry.cn-shenzhen.aliyuncs.com/thinker-vc/communicate-web:1.0.0
tags:
- node-build-mac
#- svr251
only:
- dev
build-node-pro:
image: node:11.2.0
stage: build
before_script:
- npm config set registry=http://registry.npm.taobao.org
- npm config set puppeteer_download_host=https://storage.googleapis.com.cnpmjs.org
- export APP_ENV_OS=production
script:
- npm i
- npm run build
only:
- master
tags:
- node-build-mac
#- svr251
cache:
paths:
- ./dist
docker-push-pro:
image: docker:stable
stage: push
# services:
# - docker:dind
# variables:
# DOCKER_HOST: tcp://localhost:2375
# DOCKER_DRIVER: overlay2
script:
- ls -al
- find ./ -name dist
- docker build -t registry.cn-shenzhen.aliyuncs.com/thinker-vc/communicate-web:release-1.0.0 .
- docker push registry.cn-shenzhen.aliyuncs.com/thinker-vc/communicate-web:release-1.0.0
tags:
- node-build-mac
#- svr251
only:
- master
.deploy-prod:
stage: deploy
image: registry.cn-shenzhen.aliyuncs.com/thinker-open/helm-kubectl:v2.9.1-1.10.7
before_script:
- mkdir -p /etc/deploy
- echo ${kube_config} | base64 -d > ${KUBECONFIG}
- kubectl config use-context kubernetes-admin@kubernetes
- helm init --client-only --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
- helm repo add thinker http://thinkervc:thinker@helm@helm.thinker.vc/
- helm repo update
script:
- |
helm upgrade communicate-web --install --reuse-values \
--set updateVersion=`date +%s` \
--set image.repository="registry-vpc.cn-shenzhen.aliyuncs.com/thinker-vc/communicate-web" \
--set image.tag="release-1.0.0" \
--set ingress.host="communicate.thinker.vc" \
--namespace communicate \
thinker/static
environment:
name: prod
url: communicate.thinker.vc
cache: {}
only:
- master
FROM registry.cn-shenzhen.aliyuncs.com/thinker-vc/nginx-front:1.15.1-1
COPY default.conf /etc/nginx/conf.d
COPY dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
\ No newline at end of file
server {
listen 80;
server_name localhost;
#charset koi8-r;
access_log /var/log/nginx/host.access.log main;
location /dgbg {
proxy_pass http://124.93.101.8:9988/dgbg/;
}
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /nginx-health {
access_log off;
return 200 "healthy\n";
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
\ No newline at end of file
# nginx for frontend
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment