ci: 重构 Drone CI 配置
Some checks reported errors
continuous-integration/drone/push Build was killed

- 移除了不必要的服务
This commit is contained in:
lixin 2025-01-10 13:56:34 +08:00
parent 457dd08b8d
commit be988374e8

View File

@ -1,51 +1,30 @@
kind: pipeline
type: docker
name: nodejs-22-docker-ci
services:
- name: docker
image: plugins/docker
environment:
DOCKER_TLS_CERTDIR: ""
privileged: true
name: default
steps:
- name: wait-for-dind
image: busybox
commands:
- sleep 10 # 等待 10 秒以确保 DinD 服务启动完成
- name: git-clone
image: alpine/git
commands:
- git clone http://120.48.5.80:3000/lixin/automated_api.git
- cd automated_api
- name: git-clone
image: alpine/git
commands:
- git clone http://120.48.5.80:3000/lixin/automated_api.git
- cd automated_api
- name: build-docker-image
image: plugins/docker
volumes:
- name: docker-socket
path: /var/run/docker.sock
privileged: true
working_directory: automated_api
commands:
- docker info
- docker build -t rz/automated_api:latest -f Dockerfile .
- name: run-container
image: plugins/docker
volumes:
- name: docker-socket
path: /var/run/docker.sock
privileged: true
commands:
- echo "Checking Docker version"
- docker version
- echo "Running container"
- docker run -d -p 8001:8001 rz/automated_api:latest
# 安装 Node.js 18 并设置镜像源(这里以淘宝镜像为例,可按需调整)
- name: setup-nodejs
image: node:18
- name: docker-build
image: plugins/docker
settings:
dockerfile: Dockerfile
- name: docker-run
image: docker:20.10
commands:
- docker run -d -p 8001:8001 automated_api:latest
trigger:
branch:
- main
event:
- push
- push