Gitea: Golang SDK
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.
 
 

70 lines
1.9 KiB

  1. ---
  2. kind: pipeline
  3. name: default
  4. platform:
  5. os: linux
  6. arch: amd64
  7. workspace:
  8. base: /go
  9. path: src/code.gitea.io/sdk
  10. steps:
  11. - name: gitea
  12. image: gitea/gitea:latest
  13. detach: true
  14. commands:
  15. - mkdir -p /tmp/conf/
  16. - mkdir -p /tmp/data/
  17. - echo "[security]" > /tmp/conf/app.ini
  18. - echo "INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE1NTg4MzY4ODB9.LoKQyK5TN_0kMJFVHWUW0uDAyoGjDP6Mkup4ps2VJN4" >> /tmp/conf/app.ini
  19. - echo "INSTALL_LOCK = true" >> /tmp/conf/app.ini
  20. - echo "SECRET_KEY = 2crAW4UANgvLipDS6U5obRcFosjSJHQANll6MNfX7P0G3se3fKcCwwK3szPyGcbo" >> /tmp/conf/app.ini
  21. - echo "PASSWORD_COMPLEXITY = off" >> /tmp/conf/app.ini
  22. - echo "[database]" >> /tmp/conf/app.ini
  23. - echo "DB_TYPE = sqlite3" >> /tmp/conf/app.ini
  24. - echo "[repository]" >> /tmp/conf/app.ini
  25. - echo "ROOT = /tmp/data/" >> /tmp/conf/app.ini
  26. - echo "[server]" >> /tmp/conf/app.ini
  27. - echo "ROOT_URL = http://gitea:3000" >> /tmp/conf/app.ini
  28. - gitea migrate -c /tmp/conf/app.ini
  29. - gitea admin create-user --username=test01 --password=test01 --email=test01@gitea.io --admin=true --must-change-password=false --access-token -c /tmp/conf/app.ini
  30. - gitea web -c /tmp/conf/app.ini
  31. - name: testing
  32. pull: always
  33. image: golang:1.14
  34. environment:
  35. GOPROXY: "https://goproxy.cn"
  36. GO111MODULE: "on"
  37. HTTP_PROXY: ""
  38. GITEA_SDK_TEST_URL: "http://gitea:3000"
  39. GITEA_SDK_TEST_USERNAME: "test01"
  40. GITEA_SDK_TEST_PASSWORD: "test01"
  41. #GITEA_SDK_TEST_RUN_GITEA: "true"
  42. commands:
  43. - make clean
  44. - make vet
  45. - make revive
  46. - make build
  47. - curl --noproxy "*" http://gitea:3000/api/v1/version # verify connection to instance
  48. - make test
  49. - name: discord
  50. pull: always
  51. image: appleboy/drone-discord:1.0.0
  52. environment:
  53. DISCORD_WEBHOOK_ID:
  54. from_secret: discord_webhook_id
  55. DISCORD_WEBHOOK_TOKEN:
  56. from_secret: discord_webhook_token
  57. when:
  58. event:
  59. - push
  60. - tag
  61. - pull_request
  62. status:
  63. - changed
  64. - failure