|
|
|
@ -3,45 +3,41 @@ type: docker
|
|
|
|
|
name: "CI and Deploy on maxou.dev"
|
|
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
- name: server
|
|
|
|
|
temp: {}
|
|
|
|
|
- name: server
|
|
|
|
|
temp: { }
|
|
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
|
event:
|
|
|
|
|
- push
|
|
|
|
|
event:
|
|
|
|
|
- push
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- image: node:latest
|
|
|
|
|
name: "front CI"
|
|
|
|
|
commands:
|
|
|
|
|
- npm install
|
|
|
|
|
- npm run tsc
|
|
|
|
|
# - image: node:latest
|
|
|
|
|
# name: "build node"
|
|
|
|
|
# volumes: &outputs
|
|
|
|
|
# - name: server
|
|
|
|
|
# path: /outputs
|
|
|
|
|
# depends_on:
|
|
|
|
|
# - "front CI"
|
|
|
|
|
# commands:
|
|
|
|
|
# - curl -L moshell.dev/setup.sh > /tmp/moshell_setup.sh
|
|
|
|
|
# - chmod +x /tmp/moshell_setup.sh
|
|
|
|
|
# - echo n | /tmp/moshell_setup.sh
|
|
|
|
|
# - echo "VITE_API_ENDPOINT=/IQBall/$DRONE_BRANCH/public/api" >> .env.PROD
|
|
|
|
|
# - echo "VITE_BASE=/IQBall/$DRONE_BRANCH/public" >> .env.PROD
|
|
|
|
|
# - apt update && apt install jq -y
|
|
|
|
|
# -
|
|
|
|
|
# - BASE="/IQBall/$DRONE_BRANCH/public" OUTPUT=/outputs /root/.local/bin/moshell ci/build_react.msh
|
|
|
|
|
##
|
|
|
|
|
# - image: eeacms/rsync:latest
|
|
|
|
|
# name: Deliver on staging server branch
|
|
|
|
|
# depends_on:
|
|
|
|
|
# - "prepare php"
|
|
|
|
|
# - "build node"
|
|
|
|
|
# volumes: *outputs
|
|
|
|
|
# environment:
|
|
|
|
|
# SERVER_PRIVATE_KEY:
|
|
|
|
|
# from_secret: SERVER_PRIVATE_KEY
|
|
|
|
|
# commands:
|
|
|
|
|
# - chmod +x ci/deploy.sh
|
|
|
|
|
# - ci/deploy.sh
|
|
|
|
|
- image: node:latest
|
|
|
|
|
name: "front CI"
|
|
|
|
|
commands:
|
|
|
|
|
- npm install
|
|
|
|
|
- npm run tsc
|
|
|
|
|
|
|
|
|
|
- image: node:latest
|
|
|
|
|
name: "build react"
|
|
|
|
|
volumes: &outputs
|
|
|
|
|
- name: server
|
|
|
|
|
path: /outputs
|
|
|
|
|
depends_on:
|
|
|
|
|
- "front CI"
|
|
|
|
|
commands:
|
|
|
|
|
- sed -Ei "s/VITE_BASE=/VITE_BASE=\\/${DRONE_BRANCH}/g" .env
|
|
|
|
|
- npm run build -- --base=/$DRONE_BRANCH
|
|
|
|
|
- mv dist/* /outputs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- image: eeacms/rsync:latest
|
|
|
|
|
name: Deliver on staging server branch
|
|
|
|
|
depends_on:
|
|
|
|
|
- "build react"
|
|
|
|
|
volumes: *outputs
|
|
|
|
|
environment:
|
|
|
|
|
SERVER_PRIVATE_KEY:
|
|
|
|
|
from_secret: SERVER_PRIVATE_KEY
|
|
|
|
|
commands:
|
|
|
|
|
- chmod +x ci/deploy.sh
|
|
|
|
|
- ci/deploy.sh
|