kind: pipeline name: default type: steps: - name: build image: maven:3.8.1-openjdk-8 volumes: - name: cache # The Volume's name path: /root/.m2 # The path in the container commands: #- mvn help:effective-settings # check maven - ls -hl /root/.m2/ - mvn -version - java -version - mvn help:effective-settings - mvn clean package -DskipTests - pwd - ls -hl - ls -hl railway-admin - ls -hl railway-admin/target #- name: docker # image: plugins/docker # volumes: # - name: dockersock # path: /var/run/docker.sock ## settings: # username: iamsee # password: zhuotong # from_secret: zhuotong # debug: true # launch_debug: true #insecure: true # mirror: https://mgjrzxtn.mirror.aliyuncs.com # #registry: 192.168.1.100:10000 # repo: iamsee/railway-admin # purge: true # tags: # - ${DRONE_COMMIT_SHA:1.0.0} # - ${DRONE_COMMIT} # - v1 # - latest - name: scp_files image: appleboy/drone-scp settings: host: 172.16.0.28 username: root password: $Jgkj1234 debug: true target: - /www/wwwroot/railway.ninecase.top/release - /www/wwwroot/railway.ninecase.top/release source: - railway-admin/target/railway-admin.jar - Dockerfile rm: true - name: deploy image: appleboy/drone-ssh settings: host: 172.16.0.28 username: root password: $Jgkj1234 debug: true script: - export PATH=/usr/local/bin:$PATH - echo $PATH - export LANG="en_US.UTF-8" - pkill -9 java - nohup java -jar /www/wwwroot/railway.ninecase.top/release/railway-admin/target/railway-admin.jar --spring.profiles.active=dev -Ddruid.mysql.usePingMethod=false > /www/wwwroot/railway.ninecase.top/out.log 2>&1 & - name: deploy-build-image image: appleboy/drone-ssh settings: host: 172.16.0.28 username: root password: $Jgkj1234 debug: true script: - cd /www/wwwroot/railway.ninecase.top/release - docker build -t iamsee/railway-admin:1.0.0 . - docker save -o railway-admin@1.0.0.tar iamsee/railway-admin:1.0.0 trigger: branch: - 20221201 volumes: - name: cache # The name use in this pipeline, host: path: /tmp/cache # The path be used in the host. - name: dockersock host: path: /var/run/docker.sock