This repository has been archived on 2024-08-22. You can view files and clone it, but cannot push or open issues or pull requests.
sanoid-deb/.drone.yml
2023-06-28 14:23:54 +02:00

50 lines
1.8 KiB
YAML

---
kind: pipeline
type: docker
name: default
steps:
- name: run gitleaks
image: plugins/gitleaks
settings:
path: .
- name: build
image: ubuntu:focal
environment:
DEBIAN_FRONTEND: noninteractive
commands:
- git clone https://git.mgrote.net/Mirror/sanoid.git
- cd sanoid
- # checkout latest stable release or stay on master for bleeding edge stuff (but expect bugs!)
- git checkout $(git tag | grep "^v" | tail -n 1)
- ln -s packages/debian .
- dpkg-buildpackage -uc -us
- ls -lahR
- pwd
- BUILD_DIR="./tmp"
- OUTPUT_DIR="./output"
- GIT_COMMIT_ID=$(git rev-parse --short HEAD) # git-commit-id: z.B. 39d35da
- VERSION=$(git rev-list --all --count) # Anzahl aller Commits (int)
- GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) # branch-Name
- name: upload
image: registry.mgrote.net/allzweckcontainer:latest # privates Image, Pull-Secret notwendig
environment:
DEBIAN_FRONTEND: noninteractive
auth_token:
from_secret: httpd-api-server-token
commands:
- pwd
- ls -lah ./sanhoid/output/
# upload
- |
curl -X POST -H "token: $auth_token" -F "file=@./sanhoid/output/sanhoid-${DRONE_COMMIT_SHA:0:8}.tar.gz" http://docker10.grote.lan:5040/upload
- |
curl -X POST -H "token: $auth_token" -F "file=@./sanhoid/output/sanhoid-${DRONE_COMMIT_BRANCH}.tar.gz" http://docker10.grote.lan:5040/upload
- |
curl -X POST -H "token: $auth_token" -F "file=@./sanhoid/output/sanhoid-latest.tar.gz" http://docker10.grote.lan:5040/upload
image_pull_secrets: # wird für den Login auf registry.mgrote.net benötigt
- dockerconfigjson
# siehe: https://wiki.mgrote.net/artikel/technik/drone.io_-_pull_secrets