Browse Source
- Removed the existing Drone configuration from the root directory and added a new configuration file in the scripts directory to better organize deployment scripts. - Updated the deployment command in package.json to copy the new Drone configuration file during the build process. - Adjusted the trigger branch for the deployment pipeline to 'deploy-branch' to align with the new deployment strategy. These changes improve the structure of the project and streamline the deployment process.main
3 changed files with 32 additions and 45 deletions
@ -1,44 +0,0 @@ |
|||
kind: pipeline |
|||
type: exec |
|||
name: deploy |
|||
|
|||
trigger: |
|||
branch: |
|||
- main |
|||
event: |
|||
- push |
|||
|
|||
clone: |
|||
disable: true |
|||
|
|||
steps: |
|||
- name: deploy |
|||
environment: |
|||
DEPLOY_SSH_KEY: |
|||
from_secret: DEPLOY_SSH_KEY |
|||
DATABASE_URL: |
|||
from_secret: DATABASE_URL |
|||
STATIC_DIR: |
|||
from_secret: STATIC_DIR |
|||
TMP_DIR: |
|||
from_secret: TMP_DIR |
|||
NUXT_PUBLIC_SITE_URL: |
|||
from_secret: NUXT_PUBLIC_SITE_URL |
|||
BOOTSTRAP_ADMIN_USERNAME: |
|||
from_secret: BOOTSTRAP_ADMIN_USERNAME |
|||
BOOTSTRAP_ADMIN_PASSWORD: |
|||
from_secret: BOOTSTRAP_ADMIN_PASSWORD |
|||
commands: |
|||
- export HOME=/root |
|||
- mkdir -p "$HOME/.ssh" |
|||
- chmod 700 "$HOME/.ssh" |
|||
- 'printf "%s\n" "$DEPLOY_SSH_KEY" > "$HOME/.ssh/id_rsa"' |
|||
- chmod 600 "$HOME/.ssh/id_rsa" |
|||
- 'ssh-keyscan -p 8892 -H git.xieyaxin.top >> "$HOME/.ssh/known_hosts"' |
|||
- chmod 644 "$HOME/.ssh/known_hosts" |
|||
- 'export SSH_OPTS="-i $HOME/.ssh/id_rsa -o IdentitiesOnly=yes -o UserKnownHostsFile=$HOME/.ssh/known_hosts -o StrictHostKeyChecking=accept-new -o BatchMode=yes -o ConnectTimeout=10 -o ServerAliveInterval=15 -o ServerAliveCountMax=3"' |
|||
- 'ssh $SSH_OPTS -T -p 8892 root@git.xieyaxin.top || true' |
|||
- 'REPO_DIR="$HOME/projects/nuxt4-demo/nuxt4-demo"; if [ -d "$REPO_DIR/.git" ]; then GIT_SSH_COMMAND="ssh $SSH_OPTS" git -C "$REPO_DIR" fetch origin deploy-branch && git -C "$REPO_DIR" checkout -B deploy-branch origin/deploy-branch; else rm -rf "$REPO_DIR" && mkdir -p "$(dirname "$REPO_DIR")" && GIT_SSH_COMMAND="ssh $SSH_OPTS" git clone --depth 1 -b deploy-branch "ssh://root@git.xieyaxin.top:8892/topuser/nuxt4-demo.git" "$REPO_DIR"; fi' |
|||
- 'bash -lc "pm2 stop nuxt4-demo || true"' |
|||
- 'bash -lc "pm2 delete nuxt4-demo || true"' |
|||
- 'bash -lc "pm2 start ./run.sh --name nuxt4-demo"' |
|||
@ -0,0 +1,31 @@ |
|||
kind: pipeline |
|||
type: exec |
|||
name: deploy |
|||
|
|||
trigger: |
|||
branch: |
|||
- deploy-branch |
|||
event: |
|||
- push |
|||
|
|||
steps: |
|||
- name: deploy |
|||
environment: |
|||
DATABASE_URL: |
|||
from_secret: DATABASE_URL |
|||
STATIC_DIR: |
|||
from_secret: STATIC_DIR |
|||
TMP_DIR: |
|||
from_secret: TMP_DIR |
|||
NUXT_PUBLIC_SITE_URL: |
|||
from_secret: NUXT_PUBLIC_SITE_URL |
|||
BOOTSTRAP_ADMIN_USERNAME: |
|||
from_secret: BOOTSTRAP_ADMIN_USERNAME |
|||
BOOTSTRAP_ADMIN_PASSWORD: |
|||
from_secret: BOOTSTRAP_ADMIN_PASSWORD |
|||
commands: |
|||
- export HOME=/root |
|||
- 'REPO_DIR="$HOME/projects/nuxt4-demo/nuxt4-demo"; SRC_DIR="$(pwd)"; rm -rf "$REPO_DIR"; mkdir -p "$(dirname "$REPO_DIR")"; cp -a "$SRC_DIR" "$REPO_DIR"' |
|||
- 'bash -lc "cd $HOME/projects/nuxt4-demo/nuxt4-demo && pm2 stop nuxt4-demo || true"' |
|||
- 'bash -lc "cd $HOME/projects/nuxt4-demo/nuxt4-demo && pm2 delete nuxt4-demo || true"' |
|||
- 'bash -lc "cd $HOME/projects/nuxt4-demo/nuxt4-demo && pm2 start ./run.sh --name nuxt4-demo"' |
|||
Loading…
Reference in new issue