This commit is contained in:
20
.drone.yml
20
.drone.yml
@ -34,18 +34,24 @@ steps:
|
|||||||
from_secret: CI-DEPLOY-PORT
|
from_secret: CI-DEPLOY-PORT
|
||||||
CI_DEPLOY_USER:
|
CI_DEPLOY_USER:
|
||||||
from_secret: CI-DEPLOY-USER
|
from_secret: CI-DEPLOY-USER
|
||||||
|
CI_DEPLOY_KEY:
|
||||||
|
from_secret: CI-DEPLOY-KEY
|
||||||
commands:
|
commands:
|
||||||
- mkdir -p deploy
|
- mkdir -p deploy
|
||||||
- echo "[jazzwhom_server]" > deploy/inventory.ini
|
- echo "[jazzwhom_server]" > deploy/inventory.ini
|
||||||
- echo "prod_doc_server ansible_host=$${CI_DEPLOY_SERVER} ansible_port=$${CI_DEPLOY_PORT} ansible_user=$${CI_DEPLOY_USER}" >> deploy/inventory.ini
|
- echo "prod_doc_server ansible_host=$${CI_DEPLOY_SERVER} ansible_port=$${CI_DEPLOY_PORT} ansible_user=$${CI_DEPLOY_USER}" >> deploy/inventory.ini
|
||||||
|
- echo "$${CI_DEPLOY_KEY}" > /tmp/deploy_key
|
||||||
|
- chmod 600 /tmp/deploy_key
|
||||||
- name: 部署到服务器
|
- name: 部署到服务器
|
||||||
image: plugins/ansible:latest
|
image: alpine/ansible:latest
|
||||||
settings:
|
commands:
|
||||||
playbook: deploy/deploy.ansible.yml
|
# - ansible-galaxy install --force --role-file deploy/requirements.ansible.yml
|
||||||
inventory: deploy/inventory.ini
|
- ansible-playbook \
|
||||||
galaxy: deploy/requirements.ansible.yml
|
--inventory deploy/inventory.ini \
|
||||||
private_key:
|
--private-key /tmp/deploy_key \
|
||||||
from_secret: CI-DEPLOY-KEY
|
--ssh-common-args='-o StrictHostKeyChecking=no' \
|
||||||
|
deploy/deploy.ansible.yml
|
||||||
|
|
||||||
- name: 发送构建结果到 ntfy
|
- name: 发送构建结果到 ntfy
|
||||||
image: parrazam/drone-ntfy
|
image: parrazam/drone-ntfy
|
||||||
when:
|
when:
|
||||||
|
|||||||
Reference in New Issue
Block a user