diff options
| author | Michael Grote | 2023-06-28 14:21:27 +0200 |
|---|---|---|
| committer | Michael Grote | 2023-06-28 14:21:27 +0200 |
| commit | 3d37be9c226964949c19ae1a26a6b85b4e974a47 (patch) | |
| tree | faf954f1184175aa18c326518ec60faf8a12cf56 | |
ci: add ci
| -rw-r--r-- | .drone.yml | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..24114e5 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,50 @@ +--- +kind: pipeline +type: docker +name: default +steps: + - name: run gitleaks + image: plugins/gitleaks + settings: + path: . + + - name: build + image: ubuntu:22 + 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 |