| @@ -1,9 +1,10 @@ | |||||
| kind: pipeline | kind: pipeline | ||||
| type: docker | type: docker | ||||
| name: 1 | |||||
| name: ansible | |||||
| platform: | platform: | ||||
| os: linux | os: linux | ||||
| arch: arm64 | |||||
| arch: amd64 | |||||
| steps: | steps: | ||||
| - name: maven | - name: maven | ||||
| image: maven:3-jdk-10 | image: maven:3-jdk-10 | ||||
| @@ -12,16 +13,25 @@ steps: | |||||
| path: /root/.m2 | path: /root/.m2 | ||||
| commands: | commands: | ||||
| - mvn compile | - mvn compile | ||||
| - name: check ansible syntax | |||||
| image: plugins/ansible:3 | |||||
| - name: 远程主机部署 | |||||
| image: appleboy/drone-ssh | |||||
| settings: | settings: | ||||
| playbook: ansible/playbook.yml | |||||
| galaxy: ansible/requirements.yml | |||||
| inventory: ansible/inventory | |||||
| syntax_check: true | |||||
| host: | |||||
| from_secret: ip | |||||
| username: | |||||
| from_secret: name | |||||
| password: | |||||
| from_secret: pwd | |||||
| port: 22 | |||||
| script: | |||||
| - chmod +x /home/deploy.sh | |||||
| - bash /home/deploy.sh | |||||
| volumes: | |||||
| - name: cache | |||||
| path: /root/.m2 | |||||
| trigger: | trigger: | ||||
| branch: | branch: | ||||
| - ansible | - ansible | ||||
| event: | event: | ||||
| - cron | |||||
| - push | |||||