Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

113 Zeilen
2.5 KiB

  1. kind: pipeline
  2. type: docker
  3. name: build
  4. clone:
  5. disable: true
  6. workspace:
  7. base: /drone
  8. path: src
  9. steps:
  10. - name: restore_cache
  11. image: meltwater/drone-cache
  12. pull: true
  13. settings:
  14. backend: "filesystem"
  15. restore: true
  16. cache_key: "volume"
  17. archive_format: "gzip"
  18. debug: true
  19. mount:
  20. - /drone/docker
  21. volumes:
  22. - name: cache
  23. path: /tmp/cache
  24. - name: clone
  25. image: docker:git
  26. depends_on:
  27. - restore_cache
  28. environment:
  29. KEY:
  30. from_secret: DEPLOY_KEY
  31. PUBLIC:
  32. from_secret: DEPLOY_KEY_PUBLIC
  33. GIT_HOST:
  34. from_secret: GIT_HOST
  35. GIT_PORT:
  36. from_secret: GIT_PORT
  37. GIT_REPOSITORY:
  38. from_secret: GIT_REPOSITORY
  39. commands:
  40. - eval $(ssh-agent)
  41. - mkdir $HOME/.ssh && echo "$KEY" > $HOME/.ssh/id_rsa && chmod 600 $HOME/.ssh/id_rsa && echo "$PUBLIC" > $HOME/.ssh/id_rsa.pub
  42. - ssh-add $HOME/.ssh/id_rsa
  43. - ssh-keyscan -p $GIT_PORT -H $GIT_HOST > $HOME/.ssh/known_hosts
  44. - git clone $GIT_REPOSITORY arbitry
  45. - cd arbitry && git checkout $DRONE_BRANCH && rm -rf .git
  46. - name: build_php_base
  47. image: plugins/docker
  48. privileged: true
  49. settings:
  50. #storage_driver: overlay2
  51. storage_path: /drone/docker
  52. use_cache: true
  53. dockerfile: arbitry/docker/php/Dockerfile
  54. context: arbitry
  55. registry: registry:5000
  56. repo: registry:5000/arbitry_php_base
  57. tags: ${DRONE_BRANCH//\\//-}
  58. insecure: true
  59. build_args:
  60. - PHP_VERSION=7.4.4
  61. depends_on:
  62. - clone
  63. trigger:
  64. status:
  65. - success
  66. - name: build_php_fpm
  67. image: plugins/docker
  68. privileged: true
  69. settings:
  70. #storage_driver: overlay2
  71. storage_path: /drone/docker
  72. use_cache: true
  73. dockerfile: arbitry/docker/php-fpm/Dockerfile
  74. registry: registry:5000
  75. repo: registry:5000/arbitry_php_fpm
  76. tags: ${DRONE_BRANCH//\\//-}
  77. insecure: true
  78. build_args:
  79. - BUILD_IMAGE=registry:5000/arbitry_php_base:${DRONE_BRANCH//\\//-}
  80. - PHP_VERSION=7.4.4
  81. depends_on:
  82. - build_php_base
  83. trigger:
  84. status:
  85. - success
  86. - name: rebuild_cache
  87. image: meltwater/drone-cache
  88. depends_on:
  89. - build_php_fpm
  90. pull: true
  91. settings:
  92. backend: "filesystem"
  93. rebuild: true
  94. cache_key: "volume"
  95. archive_format: "gzip"
  96. debug: true
  97. mount:
  98. - /drone/docker
  99. volumes:
  100. - name: cache
  101. path: /tmp/cache
  102. volumes:
  103. - name: cache
  104. host:
  105. path: /tmp/drone-cache