.drone.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. clone:
  2. disable: true
  3. kind: pipeline
  4. name: gin-proc
  5. steps:
  6. - image: drillster/drone-volume-cache
  7. name: restore-cache
  8. settings:
  9. mount: /drone/src
  10. restore: true
  11. volumes:
  12. - name: cache
  13. path: /cache
  14. - commands:
  15. - eval $(ssh-agent -s)
  16. - mkdir -p /root/.ssh
  17. - echo "$SSH_KEY" > /root/.ssh/id_rsa
  18. - chmod 0600 /root/.ssh/id_rsa
  19. - mkdir -p /etc/ssh
  20. - echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config
  21. - ssh-add /root/.ssh/id_rsa
  22. - git config --global user.name "gin-proc"
  23. - git config --global user.email "gin-proc@local"
  24. - ssh-keyscan -t rsa "$DRONE_GOGS_SERVER" > /root/.ssh/authorized_keys
  25. - if [ -d "$DRONE_REPO_NAME" ]; then cd "$DRONE_REPO_NAME"/; git fetch --all; git checkout -f "$DRONE_COMMIT"; else git clone "$DRONE_GIT_SSH_URL"; cd "$DRONE_REPO_NAME"/; fi
  26. - echo "Hello"
  27. environment:
  28. SSH_KEY:
  29. from_secret: DRONE_PRIVATE_SSH_KEY
  30. image: falconshock/gin-proc:micro-test
  31. name: execute
  32. volumes:
  33. - name: repo
  34. path: /repo
  35. - image: drillster/drone-volume-cache
  36. name: rebuild-cache
  37. settings:
  38. mount: /drone/src
  39. rebuild: true
  40. volumes:
  41. - name: cache
  42. path: /cache
  43. trigger:
  44. branch:
  45. - master
  46. event:
  47. - push
  48. status:
  49. - success
  50. volumes:
  51. - host:
  52. path: /gin-proc/cache
  53. name: cache