-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Populate environment variables as needed, fixes #15, fixes #16 #17
Conversation
Signed-off-by: Randy Fay <randy@randyfay.com>
Signed-off-by: Randy Fay <randy@randyfay.com>
Sure, let me know how I can help! |
@lolautruche this currently does a lot of things against your bigfoot-symfony, example: https://gist.github.com/rfay/35394655f57b5599fa1c1923887859f4 There are lots of things to be learned in trying out these hooks (now including build hooks):
Overall, these don't make me optimistic of being able to cover all (or many perhaps) of the cases of importing hooks from Platform. There are just too many assumptions built into scripts that are written for Platform. Anyway, let's talk through this and the failures and try it out. You can experiment with this using (You'll need to remove the opcache setting in your custom php to get ddev to come up) |
Thanks @rfay !
I'm still pretty sure we can cover most (if not all) of the cases with hooks 🙂 |
Oh, I note
If you'll link me to these I'll do a PR. @fapot would love to have your input on those issues. |
It seems that we're missing an environment file which is expected to be sourced ( export MIX_HOME="$PLATFORM_APP_DIR/.global/mix"
export COMPOSER_HOME="$PLATFORM_APP_DIR/.global"
export NPM_CONFIG_PREFIX="$PLATFORM_APP_DIR/.global"
export PATH="$PLATFORM_APP_DIR/.global/bin:$PLATFORM_APP_DIR/.global/composer/composer/vendor/bin:$PLATFORM_APP_DIR/.global/vendor/bin:$PATH"
export GEM_PATH="$PLATFORM_APP_DIR/.global:$PLATFORM_APP_DIR:/usr/share/rubygems-integration/all"
export PYTHONUSERBASE="$PLATFORM_APP_DIR/.global" |
That will be huge, thanks. Who expected that to be sourced? Platform? It's easy to do, looks like it will solve all kinds of problems, especially the PATH problem, which was kind of ugly. |
Also, containers may have |
The EOS error is from https://get.symfony.com/cloud/configurator - there is no EOS. @fabpot I'll do a PR if I know where that is on github. It's a bug that should be fixed. |
I sent an email to Fabien about the cloud configurator, copied you @lolautruche |
@fabpot kindly fixed the two outstanding items with cloud configurator - not killing off php-fpm and instead reloading and the missing EOS. There are a couple of other items now that I emailed him about,
|
@lolautruche the default drupal template hooks have This command results in the same output if executed in the Platform.sh site. Shouldn't this be specifying a config for import? Or something? |
Some of the handling of environment is starting to mature, and I've moved it to a homedir setup, but there are still things that don't work across all the projects I'm working with (and my platform token doesn't even get your project any more for no reason I understand) Can we spend an hour or two debugging through environment variables in different contexts? |
If this also happens on Platform, it means that we probably have a bug in our template (ping @chadwcarlson @gilzow @thomasdiluccio). You can find the template source here: https://github.com/platformsh/template-builder/tree/master/templates/drupal9/files
Sure, let's do this today during our call, together with @gilzow 🙂 |
Thanks - @fabpot fixed the things I emailed about as well. See you today! |
|
Paul on routes: |
(from discussion in https://platformsh.slack.com/archives/C0JE8AE13/p1657613433824679 )
If you haven't already given it an ID via
Then, it will look for the "current environment" via
And if no environment is found then it'll ask you to choose one. Also, many commands also need the app or worker name too, if there is more than one (similar process: from the More details on how this done in the CLI's |
…form.yaml overrides env vars we need
@lolautruche re: #17 (comment) - it seems to me like there isn't a reliable way to determine PLATFORM_ENVIRONMENT given only token+code, same with PLATFORM_PROJECT, so I'll just have to ask for both. Already doing that in latest commit, but there's a problem with merging config.*.yaml with config.yaml, already knew it would rear its head. Hope to solve in |
Most of the things addressed in this PR are now working, even though some of them are shortsighted and will have to be revisited, especially the location of the environment variables PLATFORM_ENVIRONMENT and PLATFORM_PROJECT. We're having to ask for token and both of those, but we should be storing it in the If anybody would like to try this out, it would be great. BTW, |
|
Thanks @lolautruche - that's outstanding, but how in the world can it figure that out without $PLATFORM_PROJECT already being set? Especially with a github project?
|
Holly Molly 😱 ! |
Maybe @pjcdawkins can help |
I'm pretty sure we decided in slack conversation that there's no way to be assured of knowing the project unless you already know the project. If you look around, it's not in the .platform*. If it's a direct platform-git checkout, then platform cli can look at the git remote and perhaps guess the project from that, but not for a github project like yours. |
Yes indeed, if it's fresh and not linked (using
|
Nitpicking that - it's |
I was waiting for ddev/ddev#3983 to land to continue here, and it took more work by far than I anticipated, even with a community member starting it off and doing pretty well. But I ended up running with it, then discovering flaws, etc. Then I returned here and have decided that the approach in this PR is already about as good as it's going to get. It captures the Platform.sh info and puts it in config.yaml (using So I'm going to pull this and move on to mounts, which should be interesting and less exotic. |
First work on trying to populate environment variables, including PLATFORM_ROUTES
Unfortunately, I'm probably stuck. Will need to do a collaborative debugging session to understand this I think.