Compare commits

..

3 commits

Author SHA1 Message Date
db1f4b7977
fix workdir
All checks were successful
ci/woodpecker/push/woodpecker/2 Pipeline was successful
ci/woodpecker/push/woodpecker/1 Pipeline was successful
2024-09-24 22:57:09 +02:00
618c9aa2ed
copy files to root dir again
Some checks failed
ci/woodpecker/push/woodpecker/2 Pipeline failed
ci/woodpecker/push/woodpecker/1 Pipeline failed
2024-09-24 22:39:07 +02:00
87c5bfeb75
multi image build in woodpecker 🥳
Some checks failed
ci/woodpecker/push/woodpecker/2 Pipeline failed
ci/woodpecker/push/woodpecker/1 Pipeline failed
2024-09-24 21:56:39 +02:00
2 changed files with 28 additions and 37 deletions

View file

@ -1,13 +1,18 @@
kind: pipeline when:
type: kubernetes - event: [push, manual]
name: deploy matrix:
NEXTCLOUD_VERSION:
- 28
- 29
steps: steps:
- name: patch - name: patch
image: debian image: debian
entrypoint: commands:
- /drone/src/patch-nextcloud.sh - "./patch-nextcloud.sh"
environment:
NEXTCLOUD_VERSION: ${NEXTCLOUD_VERSION}
- name: docker - name: docker
image: thegeeklab/drone-docker-buildx image: woodpeckerci/plugin-docker-buildx
privileged: true privileged: true
settings: settings:
registry: git.ar21.de registry: git.ar21.de
@ -20,10 +25,9 @@ steps:
- linux/arm64 - linux/arm64
- linux/amd64 - linux/amd64
when: when:
branch: - branch: main
- main
- name: docker-build - name: docker-build
image: thegeeklab/drone-docker-buildx image: woodpeckerci/plugin-docker-buildx
privileged: true privileged: true
settings: settings:
registry: git.ar21.de registry: git.ar21.de
@ -37,11 +41,5 @@ steps:
- linux/amd64 - linux/amd64
dry_run: true dry_run: true
when: when:
branch: - branch:
exclude: exclude: main
- main
when:
event:
include:
- push
- custom

View file

@ -1,25 +1,18 @@
#!/usr/bin/env sh #!/usr/bin/env sh
set -e set -e
echo "starting patch script" echo "==> starting patch script for nextcloud $NEXTCLOUD_VERSION"
echo "install git" echo "==> install git"
apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists apt-get update -q && apt-get install -q -y git && rm -rf /var/lib/apt/lists
echo "clone nextcloud/docker" echo "==> clone nextcloud/docker"
git clone https://git.ar21.de/aaron/nextcloud-docker.git git clone https://git.ar21.de/aaron/nextcloud-docker.git
echo "get latest major version" # save current workdir
major_version=$(find nextcloud-docker -maxdepth 1 -type d -printf "%f\n" | grep -E '^[0-9]+$' | sort -n | tail -1) WORKDIR=$(pwd)
if [ -z "$major_version" ]; then echo "==> patch the Dockerfile"
echo "Could not determine version." cd "nextcloud-docker/$NEXTCLOUD_VERSION/fpm/"
exit 1
else
echo "Nextcloud $major_version found"
fi
echo "patch the Dockerfile"
cd "nextcloud-docker/$major_version/fpm/"
sed -i "$(awk '/^ENTRYPOINT /{line=NR} END{print line}' Dockerfile)s+^+# begin of patch\nRUN apt-get update\nRUN apt-get install -y libmagickcore-6.q16-6-extra tesseract-ocr tesseract-ocr-deu tesseract-ocr-eng ocrmypdf libbz2-dev\nRUN docker-php-ext-install bz2\nRUN apt-get clean autoclean\nRUN apt-get autoremove -y\nADD https://raw.githubusercontent.com/tesseract-ocr/tessdata/main/deu.traineddata /usr/share/tesseract-ocr/tessdata/\nADD https://raw.githubusercontent.com/tesseract-ocr/tessdata/main/eng.traineddata /usr/share/tesseract-ocr/tessdata/\n# end of patch\n+" Dockerfile sed -i "$(awk '/^ENTRYPOINT /{line=NR} END{print line}' Dockerfile)s+^+# begin of patch\nRUN apt-get update\nRUN apt-get install -y libmagickcore-6.q16-6-extra tesseract-ocr tesseract-ocr-deu tesseract-ocr-eng ocrmypdf libbz2-dev\nRUN docker-php-ext-install bz2\nRUN apt-get clean autoclean\nRUN apt-get autoremove -y\nADD https://raw.githubusercontent.com/tesseract-ocr/tessdata/main/deu.traineddata /usr/share/tesseract-ocr/tessdata/\nADD https://raw.githubusercontent.com/tesseract-ocr/tessdata/main/eng.traineddata /usr/share/tesseract-ocr/tessdata/\n# end of patch\n+" Dockerfile
echo "determine tags" echo "==> determine tags"
full_version=$(grep -oP '(?<=^ENV NEXTCLOUD_VERSION ).*' Dockerfile) full_version=$(grep -oP '(?<=^ENV NEXTCLOUD_VERSION ).*' Dockerfile)
echo "found $full_version" echo "==> found $full_version"
cd /drone/src echo "$full_version" > .tags
echo "$full_version,latest" > .tags cd $WORKDIR
echo "move Dockerfile to workdir" cp -r nextcloud-docker/$NEXTCLOUD_VERSION/fpm/* .
cp -r nextcloud-docker/$major_version/fpm/* .