Compare commits

...

9 Commits
main ... test

Author SHA1 Message Date
44cfcad935
FIX: fixed path names
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-02 09:51:41 +01:00
5c2db6444f
FIX: fixed ci/cd
Some checks failed
continuous-integration/drone/push Build is failing
2024-03-02 09:49:57 +01:00
473f71772c
FIX: fixed path names
Some checks failed
continuous-integration/drone/push Build is failing
2024-03-02 09:46:26 +01:00
6a0295d5c9
FIX: fixed path names
Some checks failed
continuous-integration/drone/push Build is failing
2024-03-02 09:44:38 +01:00
3b5aa7419d
FIX: fixed path names
Some checks failed
continuous-integration/drone/push Build is failing
2024-03-02 09:40:15 +01:00
93f8462f1e
FIX: enforce long name of source container
Some checks failed
continuous-integration/drone/push Build is failing
2024-03-02 09:38:39 +01:00
7efca653e6
FIX: added git to build container
Some checks failed
continuous-integration/drone/push Build is failing
2024-03-02 09:37:01 +01:00
d5a3804136
FIX: added git to build container
Some checks failed
continuous-integration/drone/push Build is failing
2024-03-02 09:31:07 +01:00
5ae4068bec
ADD: started ci/cd
Some checks failed
continuous-integration/drone Build is failing
2024-03-02 09:25:24 +01:00
4 changed files with 132 additions and 0 deletions

94
.drone.yml Normal file
View File

@ -0,0 +1,94 @@
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: generate control
image: debian:bookworm
commands:
- apt-get -qy update && apt-get -qy install git
- scripts/generate_control.sh
- 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 -t "registry.cloud.federationhq.de/nginx-fhem-ntfy:latest-amd64" --arch amd64 .
- buildah push --all registry.cloud.federationhq.de/nginx-fhem-ntfy: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: generate control
image: debian:bookworm
commands:
- apt-get -qy update && apt-get -qy install git
- scripts/generate_control.sh
- 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 -t "registry.cloud.federationhq.de/nginx-fhem-ntfy:latest-arm64" --arch arm64 .
- buildah push --all registry.cloud.federationhq.de/nginx-fhem-ntfy: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 nginx-fhem-ntfy:latest registry.cloud.federationhq.de/nginx-fhem-ntfy:latest-arm64 registry.cloud.federationhq.de/nginx-fhem-ntfy:latest-amd64
- buildah manifest push --all nginx-fhem-ntfy:latest docker://registry.cloud.federationhq.de/nginx-fhem-ntfy:latest
- buildah manifest rm nginx-fhem-ntfy:latest
depends_on:
- build-amd64
- build-arm64

5
Containerfile Normal file
View File

@ -0,0 +1,5 @@
FROM docker.io/nginx:latest
COPY FHEM /usr/share/nginx/html/
COPY controls_byterazor-fhem-ntfy.txt /usr/share/nginx/html/
COPY CHANGED /usr/share/nginx/html/

30
scripts/generate_control.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
CONTROL_FILE="controls_byterazor-fhem-ntfy.txt"
if [ -e $CONTROL_FILE ]; then
rm $CONTROL_FILE
fi
find ./FHEM -type f \( ! -iname "0.*" \) -print0 | while IFS= read -r -d '' f;
do
out="UPD $(stat --format "%z %s" $f | sed -e "s#\([0-9-]*\)\ \([0-9:]*\)\.[0-9]*\ [+0-9]*#\1_\2#") $f"
echo "${out//.\//}" >> $CONTROL_FILE
done
#generate CHANGELOG
rm CHANGED
DATE=
git log --no-merges --pretty=format:'%ci|%s' | while read -r line; do
CDATE=$(echo "${line}" | awk '{print $1}')
MSG=$(echo "${line}" | awk -F '|' '{print $2}')
if [ "$DATE" != "$CDATE" ]; then
DATE=$CDATE
echo "$DATE" >> CHANGED
fi
echo " ${MSG}" >> CHANGED
done

3
scripts/setupEnvironment.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
cp /etc/ssl/certs2/federationHQ-CA.pem /etc/pki/ca-trust/source/anchors/
update-ca-trust