You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
918 B

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. name: ykonsole-server
  2. kind: pipeline
  3. type: docker
  4. trigger:
  5. branch:
  6. - master
  7. steps:
  8. - name: setup
  9. image: ubuntu:20.04
  10. commands:
  11. - echo -n $DRONE_BUILD_NUMBER > .tags
  12. - name: package
  13. image: plugins/docker
  14. settings:
  15. username:
  16. from_secret: docker_username
  17. password:
  18. from_secret: docker_password
  19. repo: r.vmaple.dev/ykonsole/server
  20. registry: r.vmaple.dev
  21. - name: deploy
  22. image: ubuntu:20.04
  23. environment:
  24. SSH_DRONE_PRIVATE_KEY:
  25. from_secret: ssh_private_key
  26. SSH_USERNAME:
  27. from_secret: ssh_username
  28. SSH_TARGET:
  29. from_secret: ssh_target
  30. commands:
  31. - apt-get update
  32. - apt-get -y install openssh-client
  33. - eval `ssh-agent -s`
  34. - echo "$SSH_DRONE_PRIVATE_KEY" | ssh-add -
  35. - ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$SSH_TARGET ./deploy-ykonsole.sh $DRONE_BUILD_NUMBER