|
|
|
@ -12,10 +12,8 @@ steps:
@@ -12,10 +12,8 @@ steps:
|
|
|
|
|
path: /mnt/app/build # 将应用打包好的Jar和执行脚本挂载出来 |
|
|
|
|
commands: # 定义在Docker容器中执行的shell命令 |
|
|
|
|
- mvn clean package -DskipTests=true # 应用打包命 |
|
|
|
|
- cp target/drone-demo.jar /mnt/app/build/drone-demo.jar |
|
|
|
|
- cp entrypoint.sh /mnt/app/build/ |
|
|
|
|
- cp Dockerfile /mnt/app/build/ |
|
|
|
|
- cp run.sh /mnt/app/build/ |
|
|
|
|
- sh copy.sh |
|
|
|
|
- cp docker /mnt/app/build/ |
|
|
|
|
|
|
|
|
|
- name: build-docker |
|
|
|
|
image: plugins/docker |
|
|
|
@ -24,12 +22,14 @@ steps:
@@ -24,12 +22,14 @@ steps:
|
|
|
|
|
path: /mnt/app/build # 将应用打包好的Jar和执行脚本挂载出来 |
|
|
|
|
- name: docker |
|
|
|
|
path: /var/run/docker.sock # 挂载宿主机的docker |
|
|
|
|
settings: |
|
|
|
|
dockerfile: /mnt/app/build/Dockerfile |
|
|
|
|
#settings: |
|
|
|
|
# dockerfile: /mnt/app/build/Dockerfile |
|
|
|
|
commands: # 定义在Docker容器中执行的shell命令 |
|
|
|
|
- cd /mnt/app/build |
|
|
|
|
- chmod +x run.sh |
|
|
|
|
- sh run.sh |
|
|
|
|
- cd /mnt/app/build/docker |
|
|
|
|
- chmod +x deploy.sh |
|
|
|
|
- sh deploy.sh stop |
|
|
|
|
- sh deploy.sh rm |
|
|
|
|
- sh deploy.sh module |
|
|
|
|
- docker ps |
|
|
|
|
|
|
|
|
|
volumes: # 定义流水线挂载目录,用于共享数据 |
|
|
|
|