Compare commits

..

No commits in common. "db1f4b7977db8dc9dc9e50197133b5de85c7e17c" and "1af0a476c9f870796ea98f5f850a6420d6daa79f" have entirely different histories.

2 changed files with 37 additions and 28 deletions

View file

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

View file

@ -1,18 +1,25 @@
#!/usr/bin/env sh #!/usr/bin/env sh
set -e set -e
echo "==> starting patch script for nextcloud $NEXTCLOUD_VERSION" echo "starting patch script"
echo "==> install git" echo "install git"
apt-get update -q && apt-get install -q -y git && rm -rf /var/lib/apt/lists apt-get update && apt-get install -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
# save current workdir echo "get latest major version"
WORKDIR=$(pwd) major_version=$(find nextcloud-docker -maxdepth 1 -type d -printf "%f\n" | grep -E '^[0-9]+$' | sort -n | tail -1)
echo "==> patch the Dockerfile" if [ -z "$major_version" ]; then
cd "nextcloud-docker/$NEXTCLOUD_VERSION/fpm/" echo "Could not determine version."
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"
echo "$full_version" > .tags cd /drone/src
cd $WORKDIR echo "$full_version,latest" > .tags
cp -r nextcloud-docker/$NEXTCLOUD_VERSION/fpm/* . echo "move Dockerfile to workdir"
cp -r nextcloud-docker/$major_version/fpm/* .