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,48 +1,27 @@
kind: pipeline kind: pipeline
type: docker type: docker
name: nodejs-22-docker-ci name: default
services:
- name: docker
image: plugins/docker
environment:
DOCKER_TLS_CERTDIR: ""
privileged: true
steps: steps:
- name: wait-for-dind - name: git-clone
image: busybox image: alpine/git
commands: commands:
- sleep 10 # 等待 10 秒以确保 DinD 服务启动完成 - git clone http://120.48.5.80:3000/lixin/automated_api.git
- cd automated_api
- name: git-clone # 安装 Node.js 18 并设置镜像源(这里以淘宝镜像为例,可按需调整)
image: alpine/git - name: setup-nodejs
commands: image: node:18
- git clone http://120.48.5.80:3000/lixin/automated_api.git
- cd automated_api
- name: build-docker-image - name: docker-build
image: plugins/docker image: plugins/docker
volumes: settings:
- name: docker-socket dockerfile: Dockerfile
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 - name: docker-run
image: plugins/docker image: docker:20.10
volumes: commands:
- name: docker-socket - docker run -d -p 8001:8001 automated_api:latest
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
trigger: trigger:
branch: branch: