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

46 lines
1.6 KiB
YAML
Raw Normal View History

2023-06-28 14:21:27 +02:00
---
kind: pipeline
type: docker
name: default
steps:
- name: run gitleaks
image: plugins/gitleaks
settings:
path: .
- name: build
2023-06-28 14:24:29 +02:00
image: registry.mgrote.net/allzweckcontainer:latest # privates Image, Pull-Secret notwendig
2023-06-28 14:21:27 +02:00
environment:
DEBIAN_FRONTEND: noninteractive
2023-06-28 14:41:01 +02:00
auth_token:
from_secret: httpd-api-server-token
2023-06-28 14:21:27 +02:00
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)
2023-06-28 14:43:45 +02:00
- version=$(git tag | grep "^v" | tail -n 1 | tr -d v)
2023-06-28 14:42:25 +02:00
- echo $version
2023-06-28 14:21:27 +02:00
- ln -s packages/debian .
2023-06-28 14:41:36 +02:00
- dpkg-buildpackage -uc -us
2023-06-28 14:46:04 +02:00
- sleep 460
2023-06-28 14:41:36 +02:00
# upload
2023-06-28 14:46:47 +02:00
- pwd
2023-06-28 14:44:30 +02:00
- ls -lah
- cd ..
2023-06-28 14:46:47 +02:00
- pwd
2023-06-28 14:44:30 +02:00
- la -lah
2023-06-28 14:45:26 +02:00
- sleep 460
2023-06-28 14:44:30 +02:00
- cp "sanoid_${version}_all.deb" "sanoid_latest_all.deb"
- cp "sanoid_${version}_all.deb" "sanoid_${DRONE_COMMIT_BRANCH}_all.deb"
2023-06-28 14:21:27 +02:00
- |
2023-06-28 14:40:02 +02:00
curl -X POST -H "token: $auth_token" -F "file=@../sanoid_${version}_all.deb" http://docker10.grote.lan:5040/upload
2023-06-28 14:21:27 +02:00
- |
2023-06-28 14:40:02 +02:00
curl -X POST -H "token: $auth_token" -F "file=@../sanoid_${DRONE_COMMIT_BRANCH}_all.deb" http://docker10.grote.lan:5040/upload
2023-06-28 14:21:27 +02:00
- |
2023-06-28 14:40:02 +02:00
curl -X POST -H "token: $auth_token" -F "file=@../sanoid_latest_all.deb" http://docker10.grote.lan:5040/upload
2023-06-28 14:21:27 +02:00
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