diff --git a/.drone.yml b/.drone.yml index 92c30b4..2b9d785 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,21 +12,26 @@ steps: - name: build-output path: /home/app/build commands: + - cd /drone/src - mvn clean package -DskipTests=true -pl yudao-gateway,yudao-module-system/yudao-module-system-biz,yudao-module-infra/yudao-module-infra-biz -am - - name: build-jar + - name: copy-jars image: alpine volumes: - name: build-output path: /home/app/build commands: - - mkdir -p /home/app/build/{gateway,system,infra} - - cp yudao-gateway/target/yudao-gateway.jar /home/app/build/gateway/app.jar - - cp yudao-module-system/yudao-module-system-biz/target/yudao-module-system-biz.jar /home/app/build/system/app.jar - - cp yudao-module-infra/yudao-module-infra-biz/target//yudao-module-infra-biz.jar /home/app/build/infra/app.jar + - mkdir -p /home/app/build/gateway + - mkdir -p /home/app/build/system + - mkdir -p /home/app/build/infra + - ls -l yudao-gateway/target/ # 检查源文件是否存在 + - cp yudao-gateway/target/yudao-gateway.jar /home/app/build/gateway/app.jar || echo "Failed to copy gateway jar" + - cp yudao-module-system/yudao-module-system-biz/target/yudao-module-system-biz.jar /home/app/build/system/app.jar || echo "Failed to copy system biz jar" + - cp yudao-module-infra/yudao-module-infra-biz/target/yudao-module-infra-biz.jar /home/app/build/infra/app.jar || echo "Failed to copy infra biz jar" - cp Dockerfile /home/app/build/ + - cp docker-compose.yml /home/app/build/ - - name: build-docker + - name: build-docker-images image: docker volumes: - name: build-output @@ -50,20 +55,16 @@ steps: path: /var/run/docker.sock commands: - cd /home/app/build - - cp docker-compose.yml . - - sed -i "s/\${APP_VERSION}/${APP_VERSION}/g" docker-compose.yml - - docker-compose up -d + - sed -i "s/${APP_VERSION}/${APP_VERSION}/g" docker-compose.yml + - docker-compose -f docker-compose.yml up -d volumes: - name: maven-cache host: path: /home/data/maven/cache + - name: build-output + host: + path: /home/data/maven/build - name: docker host: - path: /var/run/docker.sock - -#trigger: -# event: -# - custom -# ref: -# - refs/tags/version1.1 + path: /var/run/docker.sock \ No newline at end of file