|
@@ -4,46 +4,32 @@ type: docker |
|
|
name: 1 |
|
|
name: 1 |
|
|
platform: |
|
|
platform: |
|
|
os: linux |
|
|
os: linux |
|
|
arch: amd64 |
|
|
|
|
|
|
|
|
|
|
|
workspace: |
|
|
|
|
|
base: /opt/workspace |
|
|
|
|
|
path: work |
|
|
|
|
|
|
|
|
|
|
|
volumes: |
|
|
|
|
|
- name: m2 |
|
|
|
|
|
host: |
|
|
|
|
|
path: /root/.m2 |
|
|
|
|
|
- name: dest |
|
|
|
|
|
host: |
|
|
|
|
|
path: /root/target |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
arch: arm64 |
|
|
steps: |
|
|
steps: |
|
|
- name: maven |
|
|
|
|
|
image: maven:3-jdk-10 |
|
|
|
|
|
volumes: |
|
|
|
|
|
- name: m2 |
|
|
|
|
|
path: /root/.m2 |
|
|
|
|
|
- name: dest |
|
|
|
|
|
path: /root/target |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: 编译构建 |
|
|
|
|
|
image: gcc |
|
|
commands: |
|
|
commands: |
|
|
- mvn package |
|
|
|
|
|
- mv target/webssh.war /root/target/ |
|
|
|
|
|
- sleep 10 |
|
|
|
|
|
|
|
|
|
|
|
- name: ssh-deploy |
|
|
|
|
|
|
|
|
- ./configure |
|
|
|
|
|
- make |
|
|
|
|
|
|
|
|
|
|
|
# 需要将软件包与部署脚本提前上传到远程主机(见文件上传模板) |
|
|
|
|
|
# host、username、password可在参数管理中配置 |
|
|
|
|
|
- name: 远程主机部署 |
|
|
image: appleboy/drone-ssh |
|
|
image: appleboy/drone-ssh |
|
|
settings: |
|
|
settings: |
|
|
host: |
|
|
|
|
|
- 113.246.243.98 |
|
|
|
|
|
username: root |
|
|
|
|
|
password: wang199637 |
|
|
|
|
|
port: 4221 |
|
|
|
|
|
command_timeout: 2m |
|
|
|
|
|
|
|
|
host: |
|
|
|
|
|
from_secret: ip |
|
|
|
|
|
username: |
|
|
|
|
|
from_secret: name |
|
|
|
|
|
password: |
|
|
|
|
|
from_secret: pwd |
|
|
|
|
|
port: 22 |
|
|
script: |
|
|
script: |
|
|
- docker run -v /root/target/:/usr/local/tomcat/webapps/ -p61002:8080 -d tomcat:9.0 |
|
|
|
|
|
|
|
|
- chmod +x /home/deploy.sh |
|
|
|
|
|
- ./home/deploy.sh |
|
|
trigger: |
|
|
trigger: |
|
|
branch: |
|
|
branch: |
|
|
- master |
|
|
|
|
|
|
|
|
- container |
|
|
event: |
|
|
event: |
|
|
- push |
|
|
- push |