手动更新

develop
jasder 1 week ago
parent 6554da7dad
commit 50b215552e

@ -1,7 +1,6 @@
kind: pipeline
type: docker
name: push 操作
name: 测试流水线
platform:
os: linux
arch: amd64
@ -9,22 +8,45 @@ steps:
- name: maven
image: maven:3-jdk-10
commands:
- mvn install -DskipTests=true
- mvn package -DskipTests=true
# 本模板示例为上传软件包和部署脚本到home目录
# host、username、password可在参数管理中配置
- name: 上传文件
image: appleboy/drone-scp
settings:
host:
from_secret: deploy_ip
username:
from_secret: deploy_name
password:
from_secret: deploy_pwd
port: 22
command_timeout: 2m
target: /opt/demo
source:
- target/*.war
- Dockerfile
# 需要将软件包与部署脚本提前上传到远程主机(见文件上传模板)
# host、username、password可在参数管理中配置
- name: 远程主机部署
image: appleboy/drone-ssh
settings:
host:
from_secret: ip
from_secret: deploy_ip
username:
from_secret: name
from_secret: deploy_name
password:
from_secret: pwd
from_secret: deploy_pwd
port: 22
script:
- chmod +x /home/deploy.sh
- ./home/deploy.sh
- echo ====暂停容器开始11=======
- docker rm -f mo-test
- docker rmi mo-test:1.0
- cd /opt/demo
- echo ====开始部署=======
- docker build -t mo-test:1.0 .
- docker run -d -p 8080:8080 --name mo-test mo-test:1.0
- echo ====部署成功======
trigger:
branch:
- develop

Loading…
Cancel
Save