friendica / docker

Docker image for Friendica
https://friendi.ca
GNU Affero General Public License v3.0
49 stars 19 forks source link

Replace Travis CI with Github actions #123

Closed nupplaphil closed 4 years ago

MrPetovan commented 4 years ago

Tests are failing. 😇

nupplaphil commented 4 years ago

@tianon can you maybe help me? I try to copy the Github Action from here https://github.com/nextcloud/docker/blob/master/.github/workflows/images.yml and adapt it for Friendica. I tried several options and manually created the GIT cache directory for bashbrew, but nevertheless it fails all the time. Maybe you, as author of the bashbrew tool, can help me? I tried it temporary with the "nextcloud" repo too with the same result.

This is the error: https://github.com/friendica/docker/pull/123/checks?check_run_id=1013782050#step:3:32

fatal: cannot change to '/home/runner/.cache/bashbrew/git': No such file or directory

tianon commented 4 years ago

I'm not sure why GitHub Actions is failing, but I ran the same test locally and ran into a more clear error message:

failed fetching repo "friendica"
Tags "2020.07-apache, apache, stable-apache, 2020.07, latest, stable" has invalid Architectures: "amd64 arm32v5 arm32v7 arm64v8 i386 mips64le ppc64le s390x"

It looks like this issue was introduced in https://github.com/friendica/docker/commit/7fe1de658d8e3fb2bb9c7bd8c76d7856a6f62745?w=1#diff-bd1ee42cf5f4ce9024db9d1f6b1a82e4 -- specifically, the added quotes around $(awk) in dockerfileCommit() and the quotes around $variantArches in the Architectures: line generation are incorrect (in those cases, we want the whitespace argument splitting that the shell provides).

After fixing those in my local copy of generate-stackbrew-library.sh, it worked successfully. Here's the full delta I've got locally which worked:

diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh
index 9b8703b..679c2be 100755
--- a/generate-stackbrew-library.sh
+++ b/generate-stackbrew-library.sh
@@ -27,12 +27,12 @@ dockerfileCommit() {
   (
     cd "$dir";
     fileCommit Dockerfile \
-      "$(awk '
+      $(awk '
         toupper($1) == "COPY" {
           for (i = 2; i < NF; i++)
               print $i;
         }
-      ' Dockerfile)"
+      ' Dockerfile)
   )
 }

@@ -109,7 +109,7 @@ for version in "${versions[@]}"; do
     cat << EOE

 Tags: $(join ', ' "${variantAliases[@]}")
-Architectures: $(join ', ' "$variantArches")
+Architectures: $(join ', ' $variantArches)
 GitCommit: $commit
 Directory: $version/$variant
 EOE
nupplaphil commented 4 years ago

thx @tianon for the fast and detailed root cause explanation !!! It's now working :-)