diff --git a/.drone.yml b/.drone.yml index a849970..284853a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,9 +3,9 @@ type: kubernetes name: deploy steps: - name: patch - image: git.ar21.de/aaron/kustomize-ci - commands: - - "sh patch-nextcloud.sh" + image: debian + entrypoint: + - /drone/src/patch-nextcloud.sh - name: docker image: thegeeklab/drone-docker-buildx privileged: true diff --git a/patch-nextcloud.sh b/patch-nextcloud.sh old mode 100644 new mode 100755 index f0d7bed..c38621c --- a/patch-nextcloud.sh +++ b/patch-nextcloud.sh @@ -1,12 +1,13 @@ #!/usr/bin/env sh set -e -set -x echo "starting patch script" +echo "install git" +apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists echo "clone nextcloud/docker" git clone https://git.ar21.de/aaron/nextcloud-docker.git echo "get latest major version" major_version=$(find nextcloud-docker -maxdepth 1 -type d -printf "%f\n" | grep -E '^[0-9]+$' | sort -n | tail -1) -if [ -z "nextcloud-docker/$major_version" ]; then +if [ -z "$major_version" ]; then echo "Could not determine version." exit 1 else @@ -18,7 +19,7 @@ sed -i "$(awk '/^ENTRYPOINT /{line=NR} END{print line}' Dockerfile)s+^+# begin o echo "determine tags" full_version=$(grep -oP '(?<=^ENV NEXTCLOUD_VERSION ).*' Dockerfile) echo "found $full_version" -cd ~ +cd /drone/src echo $full_version > .tags echo "move Dockerfile to workdir" -cp nextcloud-docker/$major_version/fpm/Dockerfile . \ No newline at end of file +cp -r nextcloud-docker/$major_version/fpm/* . \ No newline at end of file