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 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: docker-build
image: plugins/docker
- name: build-docker-image settings:
image: plugins/docker dockerfile: Dockerfile
volumes:
- name: docker-socket - name: docker-run
path: /var/run/docker.sock image: docker:20.10
privileged: true commands:
working_directory: automated_api - docker run -d -p 8001:8001 automated_api:latest
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
trigger: trigger:
branch: branch:
- main - main
event: event:
- push - push