forked from jasder/java_ci
parent
dcdf776d82
commit
421623ee61
@ -1,49 +1,49 @@
|
|||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: 开发流水线
|
name: 开发流水线
|
||||||
platform:
|
platform:
|
||||||
os: linux
|
os: linux
|
||||||
arch: amd64
|
arch: amd64
|
||||||
steps:
|
steps:
|
||||||
- name: maven
|
- name: maven
|
||||||
image: maven:3-jdk-10
|
image: maven:3-jdk-10
|
||||||
commands:
|
commands:
|
||||||
- mvn install -DskipTests=true
|
- mvn install -DskipTests=true
|
||||||
# 本模板示例为上传软件包和部署脚本到home目录
|
# 本模板示例为上传软件包和部署脚本到home目录
|
||||||
# host、username、password可在参数管理中配置
|
# host、username、password可在参数管理中配置
|
||||||
- name: 上传文件
|
- name: 上传文件
|
||||||
image: appleboy/drone-scp
|
image: appleboy/drone-scp
|
||||||
settings:
|
settings:
|
||||||
host:
|
host:
|
||||||
from_secret: deploy_ip
|
from_secret: deploy_ip
|
||||||
username:
|
username:
|
||||||
from_secret: deploy_name
|
from_secret: deploy_name
|
||||||
password:
|
password:
|
||||||
from_secret: deploy_pwd
|
from_secret: deploy_pwd
|
||||||
port: 3522
|
port: 22
|
||||||
command_timeout: 2m
|
command_timeout: 2m
|
||||||
target: /opt/demo
|
target: /opt/demo
|
||||||
source:
|
source:
|
||||||
- target/*.war
|
- target/*.war
|
||||||
- Dockerfile
|
- Dockerfile
|
||||||
# 需要将软件包与部署脚本提前上传到远程主机(见文件上传模板)
|
# 需要将软件包与部署脚本提前上传到远程主机(见文件上传模板)
|
||||||
# host、username、password可在参数管理中配置
|
# host、username、password可在参数管理中配置
|
||||||
- name: 远程主机部署
|
- name: 远程主机部署
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
settings:
|
settings:
|
||||||
host:
|
host:
|
||||||
from_secret: deploy_ip
|
from_secret: deploy_ip
|
||||||
username:
|
username:
|
||||||
from_secret: deploy_name
|
from_secret: deploy_name
|
||||||
password:
|
password:
|
||||||
from_secret: deploy_pwd
|
from_secret: deploy_pwd
|
||||||
port: 3522
|
port: 3522
|
||||||
script:
|
script:
|
||||||
- echo ====暂停容器开始11=======
|
- echo ====暂停容器开始11=======
|
||||||
- docker rm -f mo-test
|
- docker rm -f mo-test
|
||||||
- docker rmi mo-test:1.0
|
- docker rmi mo-test:1.0
|
||||||
- cd /opt/demo
|
- cd /opt/demo
|
||||||
- echo ====开始部署=======
|
- echo ====开始部署=======
|
||||||
- docker build -t mo-test:1.0 .
|
- docker build -t mo-test:1.0 .
|
||||||
- docker run -d -p 8080:8080 --name mo-test mo-test:1.0
|
- docker run -d -p 8080:8080 --name mo-test mo-test:1.0
|
||||||
- echo ====部署成功======
|
- echo ====部署成功======
|
Loading…
Reference in new issue