Update '.trustie-pipeline.yml'

develop
m53297601 4 years ago
parent 5fb8c1be30
commit b2952eae22

@ -10,42 +10,31 @@ steps:
image: maven:3-jdk-10 image: maven:3-jdk-10
commands: commands:
- mvn install -DskipTests=true - mvn install -DskipTests=true
# 本模板示例为上传软件包和部署脚本到home目录 # 构建Docker镜像并推送到仓库
# host、username、password可在参数管理中配置 # 定义镜像Hub路径以及账号密码
- name: 上传文件 - name: Docker镜像构建
image: appleboy/drone-scp image: plugins/docker
settings: settings:
host: username: username
from_secret: ip password: pwd
username: repo: repoUrl
from_secret: name tags: latest
password:
from_secret: pwd
port: 22
target: /opt/demo
source:
- target/*.war
- Dockerfile
# 需要将软件包与部署脚本提前上传到远程主机(见文件上传模板) # 需要将软件包与部署脚本提前上传到远程主机(见文件上传模板)
# host、username、password可在参数管理中配置 # host、username、password可在参数管理中配置
- name: 远程主机部署 - name: 远程主机部署
image: appleboy/drone-ssh image: appleboy/drone-ssh
settings: settings:
host: host:
from_secret: ip from_secret: deploy_ip
username: username:
from_secret: name from_secret: deploy_name
password: password:
from_secret: pwd from_secret: deploy_pwd
port: 22 port: 22
script: script:
- echo ====暂停容器开始11======= - echo ====暂停容器=======
- docker rm -f mo-test - docker rm -f demo
- docker rmi mo-test:1.0 - docker run -d -p 8080:8080 --name demo demo: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 ====部署成功====== - echo ====部署成功======
trigger: trigger:
branch: branch:

Loading…
Cancel
Save