You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
java_ci/.trustie-pipeline.yml

44 lines
1002 B

4 years ago
kind: pipeline
type: docker
name: 开发流水线
platform:
os: linux
arch: amd64
steps:
- name: maven
image: maven:3-jdk-10
commands:
- mvn install -DskipTests=true
# 构建Docker镜像并推送到仓库
# 定义镜像Hub路径以及账号密码
- name: Docker镜像构建
image: plugins/docker
4 years ago
settings:
username: username
password: pwd
repo: repoUrl
tags: latest
4 years ago
# 需要将软件包与部署脚本提前上传到远程主机(见文件上传模板)
# host、username、password可在参数管理中配置
- name: 远程主机部署
image: appleboy/drone-ssh
settings:
host:
from_secret: deploy_ip
4 years ago
username:
from_secret: deploy_name
4 years ago
password:
from_secret: deploy_pwd
4 years ago
port: 22
script:
- echo ====暂停容器=======
- docker rm -f demo
- docker run -d -p 8080:8080 --name demo demo:1.0
4 years ago
- echo ====部署成功======
trigger:
branch:
- master
event:
- push