2023-10-31 21:37:36 +00:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: ci
|
|
|
|
|
|
|
|
steps:
|
2023-11-01 15:43:44 +00:00
|
|
|
- name: setup
|
2023-10-31 21:37:36 +00:00
|
|
|
image: debian:12
|
2023-11-01 15:03:33 +00:00
|
|
|
volumes:
|
2023-11-01 15:43:44 +00:00
|
|
|
- name: system
|
|
|
|
path: /
|
2023-11-01 15:03:33 +00:00
|
|
|
- name: dockersocket
|
|
|
|
path: /var/run/docker.sock
|
2023-10-31 21:37:36 +00:00
|
|
|
commands:
|
2023-11-01 14:48:52 +00:00
|
|
|
- apt-get update && apt-get install -y curl # install dependencies from apt
|
|
|
|
- curl -fsSL https://get.docker.com -o get-docker.sh # install docker
|
|
|
|
- sh ./get-docker.sh
|
2023-11-01 15:15:49 +00:00
|
|
|
- docker buildx create --name ${DRONE_COMMIT_SHA}${DRONE_BUILD_NUMBER} --use
|
2023-11-01 14:48:52 +00:00
|
|
|
- sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d # install task
|
2023-11-01 15:03:33 +00:00
|
|
|
- ./bin/task build # build the docker image
|
2023-11-01 15:43:44 +00:00
|
|
|
- name: build
|
|
|
|
image: debian:12
|
|
|
|
volumes:
|
|
|
|
- name: system
|
|
|
|
path: /
|
|
|
|
- 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
|
|
|
|
- name: publish tag
|
|
|
|
image: debian:12
|
|
|
|
environment:
|
|
|
|
PASSOWRD:
|
|
|
|
from_secret: FORGEJO_PASSWORD
|
|
|
|
volumes:
|
|
|
|
- name: system
|
|
|
|
path: /
|
|
|
|
- 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
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
|
|
|
- name: publish main
|
|
|
|
image: debian:12
|
|
|
|
environment:
|
|
|
|
PASSOWRD:
|
|
|
|
from_secret: FORGEJO_PASSWORD
|
|
|
|
volumes:
|
|
|
|
- name: system
|
|
|
|
path: /
|
|
|
|
- name: dockersocket
|
|
|
|
path: /var/run/docker.sock
|
|
|
|
commands:
|
|
|
|
- docker login -u drone -p ${PASSWORD}
|
|
|
|
- ./bin/task push TAG=main
|
|
|
|
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
|
|
|
|
- name: system
|
|
|
|
temp: {}
|