redhat-buildpacks / testing

Project aiming to help us to perform e2e tests using Buildpacks
Apache License 2.0
0 stars 3 forks source link

BuildRun fails and reports: /bin/bash: line 26: /platform/env/target/quarkus-app/*.jar: No such file or directory #7

Closed cmoulliard closed 1 year ago

cmoulliard commented 1 year ago

Issue

BuildRun fails and reports as error:

> Processing environment variables...                                                                                                                                                │
/bin/bash: line 26: /platform/env/target/quarkus-app/*.jar: No such file or directory

when we use as Task definition: https://github.com/redhat-buildpacks/testing/blob/main/k8s/shipwright/secured/clusterbuildstrategy.yml

BarDweller commented 1 year ago

The error is occuring in a part of the script that's trying to take all the current env vars and convert them into platform env files, except for a few on a block list.

I'm guessing that somehow there's a rather odd env var in the environment that seems to have the name target/quarkus-app/*.jar .. although that really does seem unlikely.

Dump the env to see what's in there, or maybe try flipping the -c on line 75 for a -x to have it run the script in debug mode where it'll display the lines it's executing

BarDweller commented 1 year ago

Seeing your comment in slack may have provided further info..

-DBP_MAVEN_BUILT_ARTIFACT="target/quarkus-app/lib/ target/quarkus-app/*.jar target/quarkus-app/app/ target/quarkus-app/quarkus/" \

I'm guessing this is in the env, which makes me suspect that the loop that's processing those env vars isn't handling spaces in the env value well.. try testing that loop locally with variations of that env var (with or without enclosing double or single quotes etc).. suspect it will fail and at somepoint end up treating the values after the spaces as if they were additional env keys, which leads the inevitable failure when it attempts to use the key as part of a filename.

cmoulliard commented 1 year ago

Fixed with new BuildStrategy.yml definition