25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

97 lines
2.2 KiB

  1. kind: pipeline
  2. type: docker
  3. name: build
  4. clone:
  5. disable: true
  6. steps:
  7. - name: restore-cache-with-filesystem
  8. image: meltwater/drone-cache:dev
  9. pull: true
  10. settings:
  11. backend: "filesystem"
  12. restore: true
  13. cache_key: "volume"
  14. archive_format: "gzip"
  15. mount:
  16. - 'vendor'
  17. volumes:
  18. - name: cache
  19. path: /tmp/cache
  20. - name: clone
  21. image: docker:git
  22. environment:
  23. KEY:
  24. from_secret: DEPLOY_KEY
  25. PUBLIC:
  26. from_secret: DEPLOY_KEY_PUBLIC
  27. GIT_HOST:
  28. from_secret: GIT_HOST
  29. GIT_PORT:
  30. from_secret: GIT_PORT
  31. GIT_REPOSITORY:
  32. from_secret: GIT_REPOSITORY
  33. commands:
  34. - eval $(ssh-agent)
  35. - mkdir $HOME/.ssh && echo "$KEY" > $HOME/.ssh/id_rsa && chmod 600 $HOME/.ssh/id_rsa && echo "$PUBLIC" > $HOME/.ssh/id_rsa.pub
  36. - ssh-add $HOME/.ssh/id_rsa
  37. - ssh-keyscan -p $GIT_PORT -H $GIT_HOST > $HOME/.ssh/known_hosts
  38. - git clone $GIT_REPOSITORY ./
  39. - git checkout $DRONE_BRANCH
  40. - name: build_php_base
  41. image: plugins/docker
  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. settings:
  62. dockerfile: docker/php-fpm/Dockerfile
  63. registry: registry:5000
  64. repo: registry:5000/arbitry_php_fpm
  65. tags: ${DRONE_BRANCH//\\//-}
  66. insecure: true
  67. build_args:
  68. - BUILD_IMAGE=registry:5000/arbitry_php_base:${DRONE_BRANCH//\\//-}
  69. - PHP_VERSION=7.4.4
  70. depends_on:
  71. - build_php_base
  72. trigger:
  73. status:
  74. - success
  75. - name: rebuild-cache-with-filesystem
  76. image: meltwater/drone-cache:dev
  77. pull: true
  78. settings:
  79. backend: "filesystem"
  80. rebuild: true
  81. cache_key: "volume"
  82. archive_format: "gzip"
  83. mount:
  84. - 'vendor'
  85. volumes:
  86. - name: cache
  87. path: /tmp/cache
  88. volumes:
  89. - name: cache
  90. temp: {}