Update '.trustie-pipeline.yml'

This commit is contained in:
jasder 2021-07-02 23:27:25 +08:00
parent e61d8ceda7
commit b93fd856d8
1 changed files with 16 additions and 25 deletions

View File

@ -1,36 +1,27 @@
#pipeline
kind: pipeline
type: docker
name: default
name: 开发流水线
platform:
os: linux
arch: amd64
steps:
- name: maven
image: maven:3-jdk-10
commands:
- mvn install -DskipTests=true
- name: Docker镜像构建1
image: plugins/docker
settings:
username: moshenglv
password: RL9UB5P7Jtzukka
repo: docker.io/moshenglv/demo
tags: latest
# 根据实际情况修改主机ip账号密码
# 需要将软件包与部署脚本提前上传到远程主机(见文件上传模板)
# host、username、password可在参数管理中配置
- name: 远程主机部署
image: appleboy/drone-ssh
settings:
host: 47.102.109.233
username: root
password: 'msl123!@#'
host:
from_secret: ip
username:
from_secret: name
password:
from_secret: pwd
port: 22
script:
- echo ====暂停容器=======
- docker rm -f demo
- docker rmi moshenglv/demo:latest
- echo ====拉取镜像=======
- docker pull moshenglv/demo:latest
- echo ====创建容器=======
- docker run -d -p 8080:8080 --name demo moshenglv/demo:latest
- echo ====部署成功======
- echo "xxxxx" > /home/test
trigger:
branch:
- master
event:
- push