Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

93 lignes
2.1 KiB

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