automated_api/.drone.yml
lixin 3f199f4b1f
Some checks reported errors
continuous-integration/drone/push Build encountered an error
ci(.drone.yml): 更新 run-container 步骤并添加 Docker 版本检查
- 调整 run-container 步骤的格式和结构
- 添加 Docker 版本检查命令
- 优化日志输出,提高构建过程的可读性
2025-01-10 13:21:39 +08:00

36 lines
790 B
YAML

kind: pipeline
type: docker
name: nodejs-22-docker-ci
#测试
steps:
- 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: docker:latest
volumes:
- name: docker-socket
path: /var/run/docker.sock
working_directory: automated_api
commands:
- docker build -t rz/automated_api:latest -f Dockerfile .
- name: run-container
image: docker:latest
volumes:
- name: docker-socket
path: /var/run/docker.sock
commands:
- echo "Checking Docker version"
- docker version
- echo "Running container"
- docker run -d -p 8001:8001 rz/automated_api:latest
trigger:
branch:
- main
event:
- push