demo ci
continuous-integration/drone/push Build is failing Details

This commit is contained in:
周炽键 2021-06-05 22:26:15 +08:00
parent 8572222960
commit ad8f790e18
6 changed files with 50 additions and 102 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
node_modules

View File

@ -7,99 +7,24 @@ trigger:
steps:
- name: net
image: praqma/network-multitool
commands:
- ifconfig
- ping -c 2 bucket || true
- name: upload
image: plugins/s3
- name: build-docker-image
image: plugins/docker
settings:
endpoint: http://bucket:9000
access_key:
from_secret: bucket_access_key
secret_key:
from_secret: bucket_secret_key
bucket: dronetest
path_style: true
source: src/*
target: /
username:
from_secret: docker_reg_username
password:
from_secret: docker_reg_password
repo: docker.zcj.plus/drone-ci/fe
tags: latest
registry: https://docker.zcj.plus
# - name: rebuild
# image: drillster/drone-volume-cache
# volumes:
# - name: modules
# path: /cache
# settings:
# rebuild: true
# mount:
# - .env
# - name: restore-modules
# image: drillster/drone-volume-cache
# volumes:
# - name: modules
# path: /cache
# settings:
# restore: true
# mount:
# - ./node_modules
# - ./yarn.lock
# - name: build
# image: node:12.16.1
# - name: prepare-deploy-file
# image: apline
# commands:
# - yarn
# - yarn build:prod
# - echo -e ""
# - name: rebuild-modules
# image: drillster/drone-volume-cache
# volumes:
# - name: modules
# path: /cache
# settings:
# rebuild: true
# mount:
# - ./node_modules
# - ./yarn.lock
# - name: scp
# image: appleboy/drone-scp
# settings:
# host: 124.156.152.247
# username:
# from_secret: ssh_username
# password:
# from_secret: ssh_pwd
# port: 8011
# target:
# - /mnt/d/deploy/fe/cidemoadmin
# source:
# - dist
# - docker-compose.yml
# - nginx.conf
# - frpc.ini
# - name: deploy
# image: appleboy/drone-ssh
# settings:
# host: 124.156.152.247
# username:
# from_secret: ssh_username
# password:
# from_secret: ssh_pwd
# port: 8011
# script:
# - cd /mnt/d/deploy/fe/cidemoadmin
# - docker-compose down
# - docker-compose up -d
# - docker-compose logs
volumes:
- name: modules
host:
path: /mnt/d/ci_volumes
- name: deploy
image: docker/compose
commands:
- docker-compose up -d
- docker-compose logs -f

16
Dockerfile Normal file
View File

@ -0,0 +1,16 @@
FROM node:lts
WORKDIR /src
COPY . .
RUN yarn global add http-server && \
npm install pm2 -g && \
yarn && \
yarn build:prod
EXPOSE 80
# CMD ["http-server","/src/dist","-p","80"]
CMD ["bash","http.sh"]

View File

@ -2,11 +2,8 @@ version: '3'
services:
nginx:
image: nginx:1.19.2
volumes:
- ./dist:/var/www
- ./nginx.conf:/etc/nginx/nginx.conf
web:
image: docker.zcj.plus/drone-ci/fe
networks:
- feadmindroneci
@ -17,7 +14,7 @@ services:
volumes:
- ./frpc.ini:/etc/frp/frpc.ini
depends_on:
- nginx
- web
restart: always
networks:

5
http.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
pm2 start http-server -i 4 -- /src/dist -p 80
pm2 monit

View File

@ -63,12 +63,16 @@ http {
server {
listen 80;
server_name demo-admin.ryio.cn;
server_name demo-admin.ryio.cn;
location / {
root /var/www;
index index.html;
try_files $uri $uri/ /index.html;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_pass http://wev/;
}
}