As you can see, for some reason when I use a variable as a part of another variable (with bash best practices) it cannot be recognized and instead, we have an empty string here.
So I decided to test whether it’s a generic issue or not and added:
This build worked fine before with pretty much the same lines and stopped working a couple of days ago. So my guess is the bash was updated recently on .com version and the behavior changed (probably a bug). I have a similar variable definition in another build on .org version of travis and it’s working fine https://travis-ci.org/wodby/base-php/jobs/639255533
The use of underscores in your environment variable names has nothing to do with the issue you are seeing.
The issue is the order in which they are currently evaluated (that is, TAGS before SOLR_VER, which TAGS depends on). This may be due to the recent introduction of the configuration validator (wodby/base-php does not use the validator, it appears), and we are looking into it.
We’ve tracked this to the data type we are using to store configuration data. Seems that the best solution would be to change the database schema, but doing so will take some time in planning and execution.
In the meantime, there are a few possible solutions:
as you can see I defined SOLR_VER before TAGS. The order of variables definition is what matters not the order how I print them, right?
And it worked fine just a few days ago.
That sounds reaaaally weird. It doesn’t sound like something solid I can rely on.
Well, I guess you did change something recently and changing it back won’t be quick. I think it would really helpful if you disclose this issue, I believe many people like me spend time trying to understand why their builds broke.
Thank you so much for replying to this issue, I thought I was going nuts.
In theory, yes. But, as I said, there is an issue with the way we process the configuration to compile the build script, and the order changes. If you click on the TAGS and SOLR_VERS, you see that the evaluation order changed when the configuration validator is on.
Well, I guess you did change something recently and changing it back won’t be quick. I think it would really helpful if you disclose this issue, I believe many people like me spend time trying to understand why their builds broke.
The issue you have encountered is a combination of a couple different things:
The feature Build Config Validation is being rolled out automatically to existing repositories, so your repository was picked up recently.
The feature parses env vars that are given as strings into env vars represented as hashes (the reasoning behind this is a long story by itself, but it is related to long standing feature requests, in short: hashes are more processable).
The build config is stored in our database in a column with the type jsonb which re-orders hashes by key length.
Thus the env vars in your build config end up being reordered by their name’s lengths, which is wrong.
We are working on moving the respective database columns from from jsonb to json.