diff --git a/.drone.yml b/.drone.yml index 6763a7f..03427cc 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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 \ No newline at end of file + - push