chore(ci): 配置 Drone CI/CD 流水线并添加 .gitignore 文件

- 添加了基于 SSH 的 Drone 流水线配置文件 (.drone.yml)
- 配置了 Docker 镜像构建、标签和推送步骤
- 设置触发条件为 develop 和 production 分支的 push 事件
- 添加了 .gitignore 文件以忽略常见开发环境文件和目录
- 包含 node_modules、dist、.env 等无需版本控制的文件和目录
- 忽略编辑器和系统生成的临时及日志文件
This commit is contained in:
danial
2025-11-03 21:40:07 +08:00
parent d2ae8accbd
commit 7dbff29d09
2 changed files with 46 additions and 0 deletions

35
.drone.yml Normal file
View File

@@ -0,0 +1,35 @@
---
kind: pipeline
type: ssh
name: master-machine
server:
host: 38.38.251.113:34156
user: root
password:
from_secret: www_password
clone:
depth: 1
steps:
- name: build new image
environment:
DOCKER_LOGIN:
from_secret: docker_login
DOCKER_TOKEN:
from_secret: docker_token
commands:
- docker login git.oceanpay.cc -u $DOCKER_LOGIN -p $DOCKER_TOKEN
- docker build -t git.oceanpay.cc/danial/jd-token-server-${DRONE_BRANCH}:${DRONE_BUILD_NUMBER} -f manifest/docker/Dockerfile . --build-arg USE_PROXY=0
- docker tag git.oceanpay.cc/danial/jd-token-server-${DRONE_BRANCH}:${DRONE_BUILD_NUMBER} git.oceanpay.cc/danial/jd-token-server-${DRONE_BRANCH}:latest
- docker push git.oceanpay.cc/danial/jd-token-server-${DRONE_BRANCH}:${DRONE_BUILD_NUMBER}
- docker push git.oceanpay.cc/danial/jd-token-server-${DRONE_BRANCH}:latest
- docker logout git.oceanpay.cc
trigger:
branch:
- develop
- production
when:
event:
- push

11
.gitignore vendored Normal file
View File

@@ -0,0 +1,11 @@
node_modules/
.DS_Store
dist/
.env
coverage/
.vscode/
.idea/
npm-debug.log*
yarn-error.log*
package-lock.json
yarn.lock