docker-s3-backup/.drone.yml

66 lines
1.6 KiB
YAML
Raw Normal View History

2023-10-31 21:37:36 +00:00
kind: pipeline
type: docker
name: ci
steps:
2023-11-01 15:43:44 +00:00
- name: build
image: debian:12
volumes:
2023-11-01 15:48:49 +00:00
- name: docker
path: /var/lib/docker
2023-11-01 15:43:44 +00:00
- name: dockersocket
path: /var/run/docker.sock
commands:
2023-11-01 16:04:39 +00:00
- sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/bin # install task
- task setup-docker
- task setup-buildx BUILDER_NAME=builder${DRONE_COMMIT_SHA}${DRONE_BUILD_NUMBER}
2023-11-01 15:43:44 +00:00
- tag=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name
2023-11-01 15:48:49 +00:00
- task build TAG=$tag # build the docker image
2023-11-01 15:43:44 +00:00
- name: publish tag
image: debian:12
2023-11-01 15:52:24 +00:00
depends_on:
- build
2023-11-01 15:43:44 +00:00
environment:
PASSOWRD:
from_secret: FORGEJO_PASSWORD
volumes:
2023-11-01 15:48:49 +00:00
- name: docker
path: /var/lib/docker
2023-11-01 15:43:44 +00:00
- name: dockersocket
path: /var/run/docker.sock
commands:
2023-11-01 16:04:39 +00:00
- sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/bin # install task
- task setup-docker
2023-11-01 15:43:44 +00:00
- docker login -u drone -p ${PASSWORD}
- tag=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name
2023-11-01 15:48:49 +00:00
- task push TAG=$tag
2023-11-01 15:43:44 +00:00
when:
event:
- tag
- name: publish main
image: debian:12
2023-11-01 15:52:24 +00:00
depends_on:
- build
2023-11-01 15:43:44 +00:00
environment:
PASSOWRD:
from_secret: FORGEJO_PASSWORD
volumes:
2023-11-01 15:48:49 +00:00
- name: docker
path: /var/lib/docker
2023-11-01 15:43:44 +00:00
- name: dockersocket
path: /var/run/docker.sock
commands:
2023-11-01 16:04:39 +00:00
- sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/bin # install task
- task setup-docker
2023-11-01 15:43:44 +00:00
- docker login -u drone -p ${PASSWORD}
2023-11-01 15:48:49 +00:00
- task push TAG=main
2023-11-01 15:43:44 +00:00
when:
branch:
- main
2023-11-01 15:03:33 +00:00
volumes:
- name: dockersocket
host:
2023-11-01 15:43:44 +00:00
path: /var/run/docker.sock
2023-11-01 15:48:49 +00:00
- name: docker
2023-11-01 15:43:44 +00:00
temp: {}