Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
yystopf | 1e6673e578 | 3 years ago |
m53297601 | 2c359e9fcd | 3 years ago |
p47623895 | d57aaf0de7 | 4 years ago |
p47623895 | 3bf40106ea | 4 years ago |
m53297601 | 07027667d2 | 4 years ago |
@ -1,56 +1,55 @@
|
|||||||
kind: pipeline
|
|
||||||
type: docker
|
kind: pipeline
|
||||||
name: 开发流水线
|
type: docker
|
||||||
platform:
|
name: 测试流水线
|
||||||
os: linux
|
platform:
|
||||||
|
os: linux
|
||||||
arch: amd64
|
arch: amd64
|
||||||
volumes:
|
|
||||||
- name: cache
|
|
||||||
host:
|
|
||||||
path: /var/lib/cache
|
|
||||||
steps:
|
steps:
|
||||||
- name: maven
|
- name: maven
|
||||||
image: maven:3-jdk-10
|
image: maven:3-jdk-10
|
||||||
volumes:
|
commands:
|
||||||
- name: cache
|
- mvn install -DskipTests=true
|
||||||
path: /root/.m2
|
# 本模板示例为上传软件包和部署脚本到home目录
|
||||||
commands:
|
# host、username、password可在参数管理中配置
|
||||||
- mvn package -DskipTests=true
|
- name: 上传文件
|
||||||
# 本模板示例为上传软件包和部署脚本到home目录
|
image: appleboy/drone-scp
|
||||||
# host、username、password可在参数管理中配置
|
settings:
|
||||||
- name: 上传文件
|
host:
|
||||||
image: appleboy/drone-scp
|
from_secret: deploy_ip
|
||||||
settings:
|
username:
|
||||||
host:
|
from_secret: deploy_name
|
||||||
from_secret: deploy_ip
|
password:
|
||||||
username:
|
from_secret: deploy_pwd
|
||||||
from_secret: deploy_name
|
port: 3522
|
||||||
password:
|
command_timeout: 2m
|
||||||
from_secret: deploy_pwd
|
target: /opt/demo
|
||||||
port: 22
|
source:
|
||||||
command_timeout: 2m
|
- target/*.war
|
||||||
target: /opt/demo
|
|
||||||
source:
|
|
||||||
- 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: 22
|
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 ====部署成功======
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- develop
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
|
|
||||||
## 操作步骤11
|
## 操作步骤
|
||||||
|
|
||||||
#### 1. 在线修改信息 src/main/java/controller/HelloWorld.java 文件信息内容,如下图:
|
#### 1. 在线修改信息 src/main/java/controller/HelloWorld.java 文件信息内容,如下图:
|
||||||
|
|
||||||
![](https://forge.educoder.net/api/attachments/1663370?raw=true)
|
![](https://forge.educoder.net/api/attachments/1663370?raw=true)
|
||||||
|
|
||||||
#### 2. 修改成功后,会自动触发构建、自动测试、自动部署
|
#### 2. 修改成功后,会自动出发构建、自动测试、自动部署
|
||||||
![](https://forge.educoder.net/api/attachments/1663375?raw=true)
|
![](https://forge.educoder.net/api/attachments/1663375)
|
||||||
|
|
||||||
|
|
||||||
#### 3. 构建成功后,访问如下链接,即可查看效果
|
#### 3. 构建成功后,访问如下链接,即可查看效果
|
||||||
http://39.98.49.211:8080/demo/hello
|
http://106.75.236.63:8080/demo/hello
|
||||||
|
|
||||||
|
|
||||||
![](https://forge.educoder.net/api/attachments/1663377?raw=true)
|
![](https://forge.educoder.net/api/attachments/1663377)
|
||||||
|
@ -1 +0,0 @@
|
|||||||
// hello world java .
|
|
Loading…
Reference in new issue