forked from natuka/web.puabadge.com
add drone
This commit is contained in:
1 parent
84061c9a18
commit
e6a821edfc
1 file changed
-125
-125
@@ -69,57 +69,7 @@ steps:
|
|||||||
- promote
|
- promote
|
||||||
target:
|
target:
|
||||||
- test
|
- test
|
||||||
- sruidtest
|
|
||||||
- name: yarn build oversea
|
|
||||||
image: node:20.11.1
|
|
||||||
volumes:
|
|
||||||
- name: web
|
|
||||||
pull: if-not-exsits
|
|
||||||
environment:
|
|
||||||
HTTP_PROXY:
|
|
||||||
from_secret: http_proxy
|
|
||||||
HTTPS_PROXY:
|
|
||||||
from_secret: https_proxy
|
|
||||||
volumes:
|
|
||||||
- name: data
|
|
||||||
path: /data
|
|
||||||
commands:
|
|
||||||
- cd /data
|
|
||||||
- env | grep -i http
|
|
||||||
- npm config set registry https://registry.npmmirror.com
|
|
||||||
- yarn
|
|
||||||
- yarn build:oversea
|
|
||||||
- chmod -R 777 dist
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- promote
|
|
||||||
target:
|
|
||||||
- oversea
|
|
||||||
- testoversea
|
|
||||||
- oem
|
|
||||||
|
|
||||||
- name: yarn build gray
|
|
||||||
image: node:20.11.1
|
|
||||||
environment:
|
|
||||||
HTTP_PROXY:
|
|
||||||
from_secret: http_proxy
|
|
||||||
HTTPS_PROXY:
|
|
||||||
from_secret: https_proxy
|
|
||||||
volumes:
|
|
||||||
- name: data
|
|
||||||
path: /data
|
|
||||||
commands:
|
|
||||||
- cd /data
|
|
||||||
- env | grep -i http
|
|
||||||
- npm config set registry https://registry.npmmirror.com
|
|
||||||
- yarn
|
|
||||||
- yarn run gray
|
|
||||||
- chmod -R 777 dist
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- promote
|
|
||||||
target:
|
|
||||||
- gray
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: web
|
- name: web
|
||||||
host:
|
host:
|
||||||
@@ -134,7 +84,6 @@ depends_on:
|
|||||||
- git
|
- git
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: exec
|
type: exec
|
||||||
@@ -152,9 +101,6 @@ steps:
|
|||||||
- promote
|
- promote
|
||||||
target:
|
target:
|
||||||
- prod
|
- prod
|
||||||
- sruid
|
|
||||||
- oversea
|
|
||||||
- oem
|
|
||||||
- name: scp to dev
|
- name: scp to dev
|
||||||
commands:
|
commands:
|
||||||
- cd /data/projects/${drone_repo_name}/dist
|
- cd /data/projects/${drone_repo_name}/dist
|
||||||
@@ -164,26 +110,6 @@ steps:
|
|||||||
- promote
|
- promote
|
||||||
target:
|
target:
|
||||||
- test
|
- test
|
||||||
- name: scp to web dev
|
|
||||||
commands:
|
|
||||||
- cd /data/projects/${drone_repo_name}/dist
|
|
||||||
- scp -r ./* api@172.31.1.254:/usr/share/nginx/web
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- promote
|
|
||||||
target:
|
|
||||||
- test
|
|
||||||
- sruidtest
|
|
||||||
- name: scp to gray
|
|
||||||
commands:
|
|
||||||
- cd /data/projects/${DRONE_REPO_NAME}/dist
|
|
||||||
- scp -r ./* ecs-user@mark.api.suwa3d.com:~/deploy/web.gray.api.suwa3d.com_8799/static
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- promote
|
|
||||||
target:
|
|
||||||
- gray
|
|
||||||
|
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- build
|
- build
|
||||||
@@ -303,57 +229,6 @@ steps:
|
|||||||
|
|
||||||
|
|
||||||
#================================= sharewow3d ==========================
|
#================================= sharewow3d ==========================
|
||||||
- name: upload to oversea oss
|
|
||||||
commands:
|
|
||||||
- python3 /home/devops/python_script/aliyun/upload.py
|
|
||||||
pull: never
|
|
||||||
image: oss2:latest
|
|
||||||
volumes:
|
|
||||||
- name: files
|
|
||||||
path: /files
|
|
||||||
- name: scripts
|
|
||||||
path: /scripts
|
|
||||||
commands:
|
|
||||||
- python3 /scripts/oss.py oversea-${DRONE_REPO_NAME} backup
|
|
||||||
- python3 /scripts/oss.py oversea-${DRONE_REPO_NAME} upload
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- promote
|
|
||||||
target:
|
|
||||||
- oversea
|
|
||||||
- name: restore to oversea oss
|
|
||||||
pull: never
|
|
||||||
image: oss2:latest
|
|
||||||
volumes:
|
|
||||||
- name: files
|
|
||||||
path: /files
|
|
||||||
- name: scripts
|
|
||||||
path: /scripts
|
|
||||||
commands:
|
|
||||||
- python3 /scripts/oss.py oversea-${DRONE_REPO_NAME} restore
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- rollback
|
|
||||||
target:
|
|
||||||
- oversea
|
|
||||||
- name: flush oversea cdn
|
|
||||||
pull: never
|
|
||||||
image: oss2:latest
|
|
||||||
volumes:
|
|
||||||
- name: files
|
|
||||||
path: /files
|
|
||||||
- name: scripts
|
|
||||||
path: /scripts
|
|
||||||
commands:
|
|
||||||
- sleep 3
|
|
||||||
- echo https://web.sharewow3d.com/ > /scripts/web.sharewow3d.com
|
|
||||||
- cd /scripts && python3 /scripts/refresh.py -r web.sharewow3d.com -t clear
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- promote
|
|
||||||
target:
|
|
||||||
- oversea
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: files
|
- name: files
|
||||||
host:
|
host:
|
||||||
|
|||||||
Reference in new issue
Block a user