git - drone - ghost - guacamole - rocket chat https://sigyl.com/
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 

127 lines
3.2 KiB

  1. load("@this//:from-secret.star", "fromSecret")
  2. load("@this//:print-secrets.star", "printSecrets")
  3. load("@this//:map.star", "map")
  4. load("@this//:environment.star", "environment")
  5. load("@this//:echo.star", "echo")
  6. load("@this//:export.star", "export")
  7. load("@this//:echo-secret.star", "echoSecret")
  8. load("@this//:wait.star", "wait")
  9. load("@this//:build.star", "build")
  10. load("@this//:scp.star", "scp")
  11. load("@this//stack:public-secrets.star", "publicSecrets")
  12. load("@this//stack:secret-secrets.star", "secretSecrets")
  13. load("@this//:rescale.star", "rescale")
  14. load("@this//:pull.star", "pull")
  15. load("@this//:deploy.star", "deploy")
  16. load("@this//:build-folder.star", "buildFolder")
  17. load("@this//:build-docker-folder.star", "buildDockerFolder")
  18. load("@this//:pipeline.star", "pipeline")
  19. def drone(
  20. ctx,
  21. branch,
  22. base,
  23. name,
  24. commands,
  25. ):
  26. if ctx.build.branch == branch:
  27. return [
  28. pipeline(
  29. branch,
  30. [
  31. wait(15, "wait"),
  32. build("drone-starlark"),
  33. printSecrets(
  34. "env-stack",
  35. publicSecrets,
  36. secretSecrets,
  37. ),
  38. build("gitea"),
  39. build("guacamole-postgresql"),
  40. build("ngrok-gitea"),
  41. build("letsencrypt-nginx"),
  42. build("ghost"),
  43. buildDockerFolder(
  44. "Dockerfile.git",
  45. "$${LOCAL_DOCKER_REGISTRY}letsencrypt-nginx",
  46. "$${LOCAL_DOCKER_REGISTRY}letsencrypt-git",
  47. "letsencrypt-nginx",
  48. "git",
  49. ),
  50. buildDockerFolder(
  51. "Dockerfile.drone",
  52. "$${LOCAL_DOCKER_REGISTRY}letsencrypt-nginx",
  53. "$${LOCAL_DOCKER_REGISTRY}letsencrypt-drone",
  54. "letsencrypt-nginx",
  55. "drone",
  56. ),
  57. buildDockerFolder(
  58. "Dockerfile.registry",
  59. "$${LOCAL_DOCKER_REGISTRY}letsencrypt-nginx",
  60. "$${LOCAL_DOCKER_REGISTRY}letsencrypt-registry",
  61. "letsencrypt-nginx",
  62. "registry",
  63. ),
  64. scp(base),
  65. pull(
  66. "pull images",
  67. [
  68. "drone-starlark",
  69. "gitea",
  70. "ghost",
  71. "ngrok-gitea",
  72. "letsencrypt-git",
  73. "letsencrypt-drone",
  74. "guacamole-postgresql",
  75. ],
  76. ),
  77. #pull(
  78. # "pull registry",
  79. # [
  80. # "letsencrypt-registry",
  81. # ],
  82. #),
  83. #deploy(
  84. # "docker-compose-registry.yml",
  85. # 'registry',
  86. # base,
  87. # publicSecrets + secretSecrets,
  88. # commands,
  89. # ctx
  90. #),
  91. deploy(
  92. "docker-compose.yml",
  93. name,
  94. base,
  95. publicSecrets + secretSecrets,
  96. commands,
  97. ctx
  98. ),
  99. ],
  100. [],
  101. [
  102. {
  103. "name": "ca",
  104. "host": {
  105. "path": "{base}/.ca".format(base = base),
  106. },
  107. }
  108. ],
  109. [
  110. {
  111. "name": "ca",
  112. "path": "/etc/docker/certs.d",
  113. },
  114. ]
  115. ),
  116. ]
  117. else:
  118. return pipeline(
  119. ctx.build.branch,
  120. [],
  121. [],
  122. [],
  123. [],
  124. )