添加 '.drone.yml'
This commit is contained in:
parent
8b924446ed
commit
65c3cbc0ec
42
.drone.yml
Normal file
42
.drone.yml
Normal file
@ -0,0 +1,42 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: jar-deploy
|
||||
trigger:
|
||||
event: [ push ]
|
||||
branch: [ main ]
|
||||
steps:
|
||||
- name: build-package
|
||||
image: maven:3.8-openjdk-8
|
||||
volumes:
|
||||
- name: maven-cache
|
||||
path: /root/.m2
|
||||
- name: maven-build
|
||||
path: /app/build
|
||||
commands:
|
||||
- mvn clean package # 应用打包命令
|
||||
- cp target/scenic-1.0-SNAPSHOT.jar /app/build/scenic-1.0-SNAPSHOT.jar
|
||||
- cp Dockerfile /app/build/Dockerfile
|
||||
- cp run.sh /app/build/run.sh
|
||||
- name: deploy-start
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host: 1.116.245.89
|
||||
username: root
|
||||
password:
|
||||
from_secret: ssh_password
|
||||
port: 22 # 远程连接端口
|
||||
command_timeout: 5m
|
||||
script:
|
||||
- cd /root/docker/maven/build
|
||||
- chmod +x run.sh
|
||||
- ./run.sh
|
||||
# when:
|
||||
# event:
|
||||
# - promote
|
||||
volumes:
|
||||
- name: maven-build
|
||||
host:
|
||||
path: /root/docker/maven/build
|
||||
- name: maven-cache
|
||||
host:
|
||||
path: /root/docker/maven/cache
|
Loading…
Reference in New Issue
Block a user