| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- 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: deploy.iamsee.com
- username: root
- password: $jgkj001
- debug: true
- target: /tmp/jar
- source: railway-admin/target/railway-admin.jar
- - name: deploy
- image: appleboy/drone-ssh
- settings:
- host: deploy.iamsee.com
- username: root
- password: $jgkj001
- debug: true
- script:
- - export PATH=/usr/local/bin:$PATH
- - echo $PATH
- # - a=`docker ps -a | grep "railway-admin" | awk '{print $1 }'` && [[ ${#a} -ne "" ]] && docker stop "${a}" && docker rm "${a}"
- - export has=`docker ps -a | grep "railway-admin$" | wc -l`
- - export id=`docker ps -a | grep "railway-admin$" | awk '{print $1 }'`
- - echo $has && echo $id && if [[ has -gt 0 ]] ; then docker stop $id && docker rm $id ; fi;
- - docker image rm iamsee/railway-admin
- - docker run -itd --name railway-admin -p 2021:2021 iamsee/railway-admin:latest
- 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
-
|