From cb9e4f043304d3814d0c43e030c415b1ed167737 Mon Sep 17 00:00:00 2001 From: npmrun <1549469775@qq.com> Date: Wed, 29 Apr 2026 15:27:44 +0800 Subject: [PATCH] feat(drone): add new deployment pipeline configuration - Introduced a new Drone CI/CD pipeline configuration file to manage deployment processes. - Set up environment variables for database and static directory management, enhancing security by using secrets. - Implemented commands for managing the project directory and controlling the PM2 process during deployment. These changes establish a structured deployment pipeline, improving the automation and reliability of the deployment process. --- build-files/.drone.yml | 31 +++++++++++++++++++++++++++++++ scripts/.drone.yml | 31 ------------------------------- 2 files changed, 31 insertions(+), 31 deletions(-) create mode 100644 build-files/.drone.yml delete mode 100644 scripts/.drone.yml diff --git a/build-files/.drone.yml b/build-files/.drone.yml new file mode 100644 index 0000000..219e8d3 --- /dev/null +++ b/build-files/.drone.yml @@ -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"' \ No newline at end of file diff --git a/scripts/.drone.yml b/scripts/.drone.yml deleted file mode 100644 index 219e8d3..0000000 --- a/scripts/.drone.yml +++ /dev/null @@ -1,31 +0,0 @@ -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"' \ No newline at end of file