ci: 简化 Drone CI 配置文件
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
- 移除了多余的空行和注释 - 保留了代码拉取、Docker 镜像构建和容器运行的基本步骤
This commit is contained in:
parent
848a729cca
commit
8f2a100c31
@ -3,14 +3,11 @@ type: docker
|
|||||||
name: nodejs-22-docker-ci
|
name: nodejs-22-docker-ci
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# 拉取代码
|
|
||||||
- name: clone
|
- name: clone
|
||||||
image: alpine/git
|
image: alpine/git
|
||||||
commands:
|
commands:
|
||||||
- git clone http://120.48.5.80:3000/lixin/automated_api.git
|
- git clone http://120.48.5.80:3000/lixin/automated_api.git
|
||||||
- cd automated_api
|
- cd automated_api
|
||||||
|
|
||||||
# 构建 Docker 镜像(使用当前文件夹下的 Dockerfile)
|
|
||||||
- name: build-docker-image
|
- name: build-docker-image
|
||||||
image: docker:latest
|
image: docker:latest
|
||||||
volumes:
|
volumes:
|
||||||
@ -19,13 +16,10 @@ steps:
|
|||||||
working-directory: automated_api
|
working-directory: automated_api
|
||||||
commands:
|
commands:
|
||||||
- docker build -t rz/automated_api:latest -f Dockerfile.
|
- docker build -t rz/automated_api:latest -f Dockerfile.
|
||||||
|
|
||||||
# 运行容器(这里简单在本地运行,可按需调整为远程部署等,示例中假设容器内应用监听3000端口,映射到主机3000端口)
|
|
||||||
- name: run-container
|
- name: run-container
|
||||||
image: docker:latest
|
image: docker:latest
|
||||||
commands:
|
commands:
|
||||||
- docker run -d -p 8001:8001 rz/automated_api:latest
|
- docker run -d -p 8001:8001 rz/automated_api:latest
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: docker-socket
|
- name: docker-socket
|
||||||
host:
|
host:
|
||||||
|
Loading…
Reference in New Issue
Block a user