From 9e9dfd729f109c1c1f38b1e8b33d0e8b1109b329 Mon Sep 17 00:00:00 2001 From: Dominik Meyer Date: Fri, 2 Feb 2024 13:33:38 +0100 Subject: [PATCH] ADD: initial commit --- .drone.yml | 82 +++++++++++++++++++++++++++++++++++++ Containerfile | 17 ++++++++ LICENSE | 21 ++++++++++ README.md | 47 +++++++++++++++++++++ scripts/plugin.sh | 3 ++ scripts/setupEnvironment.sh | 3 ++ 6 files changed, 173 insertions(+) create mode 100644 .drone.yml create mode 100644 Containerfile create mode 100644 LICENSE create mode 100644 README.md create mode 100755 scripts/plugin.sh create mode 100755 scripts/setupEnvironment.sh diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..a0387e3 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,82 @@ +kind: pipeline +type: kubernetes +name: build-amd64 +platform: + arch: amd64 +node_selector: + kubernetes.io/arch: amd64 + +volumes: +- name: fedhq-ca-crt + config_map: + name: fedhq-ca-crt + default_mode: 420 # same as 644 in octal, or u+w,a+r + optional: false + +steps: + - name: build amd64 + image: quay.io/buildah/stable + privileged: true + volumes: + - name: fedhq-ca-crt + path: /etc/ssl/certs2/ + commands: + - scripts/setupEnvironment.sh + - buildah bud --network host -t "registry.cloud.federationhq.de/hid:latest-amd64" --arch amd64 . + - buildah push --all registry.cloud.federationhq.de/hid:latest-amd64 +--- +kind: pipeline +type: kubernetes +name: build-arm64 +platform: + arch: arm64 +node_selector: + kubernetes.io/arch: arm64 + +volumes: +- name: fedhq-ca-crt + config_map: + name: fedhq-ca-crt + default_mode: 420 # same as 644 in octal, or u+w,a+r + optional: false + +steps: + - name: build arm64 + image: quay.io/buildah/stable + privileged: true + volumes: + - name: fedhq-ca-crt + path: /etc/ssl/certs2/ + commands: + - scripts/setupEnvironment.sh + - buildah bud --network host -t "registry.cloud.federationhq.de/hid:latest-arm64" --arch arm64 . + - buildah push --all registry.cloud.federationhq.de/hid:latest-arm64 +--- +kind: pipeline +type: kubernetes +name: push +node_selector: + kubernetes.io/arch: amd64 + +volumes: +- name: fedhq-ca-crt + config_map: + name: fedhq-ca-crt + default_mode: 420 # same as 644 in octal, or u+w,a+r + optional: false + +steps: + - name: push + image: quay.io/buildah/stable + privileged: true + volumes: + - name: fedhq-ca-crt + path: /etc/ssl/certs2/ + commands: + - scripts/setupEnvironment.sh + - buildah manifest create hid:latest registry.cloud.federationhq.de/hid:latest-arm64 registry.cloud.federationhq.de/hid:latest-amd64 + - buildah manifest push --all hid:latest docker://registry.cloud.federationhq.de/hid:latest + - buildah manifest rm hid:latest +depends_on: + - build-amd64 + - build-arm64 diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..8fabb06 --- /dev/null +++ b/Containerfile @@ -0,0 +1,17 @@ +FROM alpine + +RUN apk update && apk add --no-cache tini bash perl-app-cpanminus + +RUN cpanm install HiD +RUN cpanm install HiD::Generator::BibtexPage + +ADD scripts/entryPoint.sh /plugin.sh +RUN chmod +x /plugin.sh + +# add a user for running imapfilter in the container +RUN addgroup hid && adduser -D -G hid hid + +# run everything as the hid user +USER hid + +ENTRYPOINT ["/sbin/tini", "--", "/plugin.sh"] \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..38dfa66 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) [2024] [Dominik Meyer] + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..25eb652 --- /dev/null +++ b/README.md @@ -0,0 +1,47 @@ +--- +lang: EN_US +--- + +# HiD Drone Plugin + +## Description + +Drone Plugin for running HiD (https://metacpan.org/pod/HiD) + + +## Supported Architectures + +- amd64 +- arm64 + +## Updates + +I am trying to update the image weekly as long as my private kubernetes cluster is available. So I do not promise anything and do **not** rely +your business on this image. + +## Prerequisities + +A container runtime like + +* docker +* podman +* kubernetes + + +## Container Parameters + +None + + + +## Source Repository + +* https://gitea.federationhq.de/Container/hid.git + +## Authors + +* **Dominik Meyer** - *Initial work* + +## License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. diff --git a/scripts/plugin.sh b/scripts/plugin.sh new file mode 100755 index 0000000..cfbefe9 --- /dev/null +++ b/scripts/plugin.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +hid publish diff --git a/scripts/setupEnvironment.sh b/scripts/setupEnvironment.sh new file mode 100755 index 0000000..2761ce0 --- /dev/null +++ b/scripts/setupEnvironment.sh @@ -0,0 +1,3 @@ +#!/bin/bash +cp /etc/ssl/certs2/federationHQ-CA.pem /etc/pki/ca-trust/source/anchors/ +update-ca-trust