Open scottfalkingham opened 3 years ago
I'll also note that my contacts at Platform.sh said that they are working to make the default branch 'main' soon, so this will need to be addressed because of that as well. Thank you.
@scottfalkingham @ddrager good to know. How are you all using PLATFORM_BRANCH
? are you using it in your application code or for some other purpose?
@pirog it was going to be used in application code to toggle between development and production environments.
I have a github repo (default branch: main) that is linked to platform.sh (also default branch: main).
This bug breaks the platform CLI.
Steps to reproduce
my-dev-branch
.lando platform environment:synchronize data -y
.What I expected: main
to be downloaded into my local environment.
What happened:
[InvalidArgumentException]
Specified environment not found: master
EDIT:
This can be worked around by setting --environment my-dev-branch
.
The
PLATFORM_BRANCH
environment variable does not reflect the branch that is actually being used. It remains asmaster
.Investigating the code, it appears
master
is hardcoded when it generates/etc/profile.d/01-variables.sh
.https://github.com/lando/lando/blob/223635263301a55dd9f269d51bcb269229e14d07/integrations/lando-platformsh/lib/run.js#L138
To reproduce, check out a branch that is not
master
and runlando rebuild
and thenlando php -i | grep PLATFORM_BRANCH
. It will return: