diff --git a/.drone.yml b/.drone.yml index ded0f47..3cb0c80 100644 --- a/.drone.yml +++ b/.drone.yml @@ -34,18 +34,24 @@ steps: from_secret: CI-DEPLOY-PORT CI_DEPLOY_USER: from_secret: CI-DEPLOY-USER + CI_DEPLOY_KEY: + from_secret: CI-DEPLOY-KEY commands: - mkdir -p deploy - 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 "$${CI_DEPLOY_KEY}" > /tmp/deploy_key + - chmod 600 /tmp/deploy_key - name: 部署到服务器 - image: plugins/ansible:latest - settings: - playbook: deploy/deploy.ansible.yml - inventory: deploy/inventory.ini - galaxy: deploy/requirements.ansible.yml - private_key: - from_secret: CI-DEPLOY-KEY + image: alpine/ansible:latest + commands: + # - ansible-galaxy install --force --role-file deploy/requirements.ansible.yml + - ansible-playbook \ + --inventory deploy/inventory.ini \ + --private-key /tmp/deploy_key \ + --ssh-common-args='-o StrictHostKeyChecking=no' \ + deploy/deploy.ansible.yml + - name: 发送构建结果到 ntfy image: parrazam/drone-ntfy when: