From f4e78814c0c6599e6fa944a7ccf883c9f4951dcb Mon Sep 17 00:00:00 2001 From: jhot Date: Wed, 1 Nov 2023 09:48:49 -0600 Subject: [PATCH] Cache not the whole world --- .drone.yml | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/.drone.yml b/.drone.yml index d93a1ed..a9fc167 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,8 +6,10 @@ steps: - name: setup image: debian:12 volumes: - - name: system - path: / + - name: docker + path: /var/lib/docker + - name: usrbin + path: /usr/bin - name: dockersocket path: /var/run/docker.sock commands: @@ -15,32 +17,36 @@ steps: - curl -fsSL https://get.docker.com -o get-docker.sh # install docker - sh ./get-docker.sh - docker buildx create --name ${DRONE_COMMIT_SHA}${DRONE_BUILD_NUMBER} --use - - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d # install task - - ./bin/task build # build the docker image + - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/bin # install task + # - task build # build the docker image - name: build image: debian:12 volumes: - - name: system - path: / + - name: docker + path: /var/lib/docker + - name: usrbin + path: /usr/bin - name: dockersocket path: /var/run/docker.sock commands: - tag=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name - - ./bin/task build TAG=$tag # build the docker image + - task build TAG=$tag # build the docker image - name: publish tag image: debian:12 environment: PASSOWRD: from_secret: FORGEJO_PASSWORD volumes: - - name: system - path: / + - name: docker + path: /var/lib/docker + - name: usrbin + path: /usr/bin - name: dockersocket path: /var/run/docker.sock commands: - docker login -u drone -p ${PASSWORD} - tag=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name - - ./bin/task push TAG=$tag + - task push TAG=$tag when: event: - tag @@ -50,13 +56,15 @@ steps: PASSOWRD: from_secret: FORGEJO_PASSWORD volumes: - - name: system - path: / + - name: docker + path: /var/lib/docker + - name: usrbin + path: /usr/bin - name: dockersocket path: /var/run/docker.sock commands: - docker login -u drone -p ${PASSWORD} - - ./bin/task push TAG=main + - task push TAG=main when: branch: - main @@ -65,5 +73,7 @@ volumes: - name: dockersocket host: path: /var/run/docker.sock -- name: system +- name: docker + temp: {} +- name: usrbin temp: {} \ No newline at end of file