|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- kind: pipeline
- type: docker
- name: build
-
- clone:
- disable: true
-
- workspace:
- base: /drone
- path: src
-
- steps:
- - name: restore_cache
- image: meltwater/drone-cache
- pull: true
- settings:
- backend: "filesystem"
- restore: true
- cache_key: "volume"
- archive_format: "gzip"
- debug: true
- mount:
- - /drone/docker
- volumes:
- - name: cache
- path: /tmp/cache
-
- - name: clone
- image: docker:git
- depends_on:
- - restore_cache
- environment:
- KEY:
- from_secret: DEPLOY_KEY
- PUBLIC:
- from_secret: DEPLOY_KEY_PUBLIC
- GIT_HOST:
- from_secret: GIT_HOST
- GIT_PORT:
- from_secret: GIT_PORT
- GIT_REPOSITORY:
- from_secret: GIT_REPOSITORY
- commands:
- - eval $(ssh-agent)
- - mkdir $HOME/.ssh && echo "$KEY" > $HOME/.ssh/id_rsa && chmod 600 $HOME/.ssh/id_rsa && echo "$PUBLIC" > $HOME/.ssh/id_rsa.pub
- - ssh-add $HOME/.ssh/id_rsa
- - ssh-keyscan -p $GIT_PORT -H $GIT_HOST > $HOME/.ssh/known_hosts
- - git clone $GIT_REPOSITORY arbitry
- - cd arbitry && git checkout $DRONE_BRANCH && rm -rf .git
-
- - name: build_php_base
- image: plugins/docker
- privileged: true
- settings:
- #storage_driver: overlay2
- storage_path: /drone/docker
- use_cache: true
- dockerfile: arbitry/docker/php/Dockerfile
- context: arbitry
- registry: registry:5000
- repo: registry:5000/arbitry_php_base
- tags: ${DRONE_BRANCH//\\//-}
- insecure: true
- build_args:
- - PHP_VERSION=7.4.4
- depends_on:
- - clone
- trigger:
- status:
- - success
-
- - name: build_php_fpm
- image: plugins/docker
- privileged: true
- settings:
- #storage_driver: overlay2
- storage_path: /drone/docker
- use_cache: true
- dockerfile: arbitry/docker/php-fpm/Dockerfile
- registry: registry:5000
- repo: registry:5000/arbitry_php_fpm
- tags: ${DRONE_BRANCH//\\//-}
- insecure: true
- build_args:
- - BUILD_IMAGE=registry:5000/arbitry_php_base:${DRONE_BRANCH//\\//-}
- - PHP_VERSION=7.4.4
- depends_on:
- - build_php_base
- trigger:
- status:
- - success
-
- - name: rebuild_cache
- image: meltwater/drone-cache
- depends_on:
- - build_php_fpm
- pull: true
- settings:
- backend: "filesystem"
- rebuild: true
- cache_key: "volume"
- archive_format: "gzip"
- debug: true
- mount:
- - /drone/docker
- volumes:
- - name: cache
- path: /tmp/cache
-
- volumes:
- - name: cache
- host:
- path: /tmp/drone-cache
|