Closed flovntp closed 1 year ago
Hi @rfay
thanks to @lolautruche, i understand what i was missing and maybe i misunderstood the starting point of this addon, which is : "having a project already configure for using ddev (aka. ddev config
already executed)"
and the addon permit to copy/duplicate the existing PSH provisioning".
So, if i recap :
platform get <IDProject>
ddev config
ddev get platformsh/ddev-platformsh
and it will read PSH provisioning and create docker containers.so, as a suggestion, maybe next steps for this addons should/could be :
ddev get platformsh/ddev-platformsh
and there is no config.yaml file --> ask to user if we need to execute it? platform get <ProjectID>
(or ideally, ddev run it for him with: PSH login, then user choose a project in the list of existing PSH projects and run platform get <choosenProjectId)
)...My 2 cents
ps: you can close the issue :P
ok, so now, my Symfony project seems to be configured but with an error at the end, while getting DATABASE infos
flovntp@VNTP-Book-2 sfcon2022-workshop-ddev % ddev get platformsh/ddev-platformsh
Downloading https://api.github.com/repos/platformsh/ddev-platformsh/tarball/v0.4.3
v0.4.3_3495880585.tar.gz 96.44 KiB / ? [------------------------------------------------=------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 987.51% 0s
Please enter your platform.sh token:
XXXXXXXXX-XXXX-XXXX-XXXX-XXXXdbd638
Global configuration:
instrumentation-opt-in=true
omit-containers=[]
web-environment=[BLACKFIRE_CLIENT_ID=XXXX,BLACKFIRE_CLIENT_TOKEN=XXXX,BLACKFIRE_SERVER_ID=XXXX,BLACKFIRE_SERVER_TOKEN=XXXX,PLATFORMSH_CLI_TOKEN=XXXXXXXXX-XXXX-XXXX-XXXX-XXXXdbd638]
mutagen-enabled=false
nfs-mount-enabled=false
router-bind-all-interfaces=false
internet-detection-timeout-ms=3000
disable-http2=false
use-letsencrypt=false
letsencrypt-email=
table-style=default
simple-formatting=false
auto-restart-containers=false
use-hardened-images=false
fail-on-hook-fail=false
required-docker-compose-version=
use-docker-compose-from-path=false
no-bind-mounts=false
project-tld=
PLATFORMSH_CLI_TOKEN set globally
Please enter your platform.sh project ID (like '6k4ypl5iendqd'):
4qqp5j5vtvnom
platform_project = '4qqp5j5vtvnom'
You are reconfiguring the project at /Users/flovntp/Sites/Customers/PlatformSH/sfcon2022-workshop-ddev.
The existing configuration will be updated and replaced.
Configuring unrecognized codebase as project type 'php' at /Users/flovntp/Sites/Customers/PlatformSH/sfcon2022-workshop-ddev/_www
v1.21.3: Pulling from drud/ddev-webserver
e54debc59c92: Pulling fs layer
e54debc59c92: Download complete
e54debc59c92: Pull complete
Digest: sha256:XXXXXXXXX
Status: Downloaded newer image for drud/ddev-webserver:v1.21.3
docker.io/drud/ddev-webserver:v1.21.3
Configuration complete. You may now run 'ddev start'.
PLATFORM_PROJECT set to 4qqp5j5vtvnom
You are reconfiguring the project at /Users/flovntp/Sites/Customers/PlatformSH/sfcon2022-workshop-ddev.
The existing configuration will be updated and replaced.
Configuring unrecognized codebase as project type 'php' at /Users/flovntp/Sites/Customers/PlatformSH/sfcon2022-workshop-ddev/_www
Configuration complete. You may now run 'ddev start'.
Please enter your platform.sh project environment (like 'main'):
You are reconfiguring the project at /Users/flovntp/Sites/Customers/PlatformSH/sfcon2022-workshop-ddev.
The existing configuration will be updated and replaced.
Configuring unrecognized codebase as project type 'php' at /Users/flovntp/Sites/Customers/PlatformSH/sfcon2022-workshop-ddev/_www
Configuration complete. You may now run 'ddev start'.
Installed file /Users/flovntp/Sites/Customers/PlatformSH/sfcon2022-workshop-ddev/.ddev/web-build/Dockerfile.platformsh
Installed file /Users/flovntp/Sites/Customers/PlatformSH/sfcon2022-workshop-ddev/.ddev/homeadditions/.bashrc.d/platformsh-environment.sh
Installed file /Users/flovntp/Sites/Customers/PlatformSH/sfcon2022-workshop-ddev/.ddev/providers/platform.yaml
Installed file /Users/flovntp/.ddev/commands/web/platform
could not process post-install action '#ddev-nodisplay
cd ..
unset DDEV_DEBUG
project_type=$(ddev describe -j | jq -r .raw.type)
case $project_type in
laravel)
# TODO: This depends on perl, but we can't start the project unless these are created
# so can't use ddev exec yet.
perl -p -e 's/DB_(HOST|DATABASE|USERNAME|PASSWORD)=(.*)/DB_\1=db/g' .env.example >.env
perl -pi.bak -e "s#APP_URL=.*#APP_URL=${DDEV_PRIMARY_URL}#g" .env
;;
drupal9)
mkdir -p .drush
;;
esac
': Unable to run action set -eu -o pipefail
#ddev-nodisplay
cd ..
unset DDEV_DEBUG
project_type=$(ddev describe -j | jq -r .raw.type)
case $project_type in
laravel)
# TODO: This depends on perl, but we can't start the project unless these are created
# so can't use ddev exec yet.
perl -p -e 's/DB_(HOST|DATABASE|USERNAME|PASSWORD)=(.*)/DB_\1=db/g' .env.example >.env
perl -pi.bak -e "s#APP_URL=.*#APP_URL=${DDEV_PRIMARY_URL}#g" .env
;;
drupal9)
mkdir -p .drush
;;
esac
: exit status 127, output=bash: line 4: jq: command not found
So i guess it is the step where you try to find in the environment variable, all info about DATABASE_* ? Let me know, i could help on this part.
It's probably because you don't have jq
locally. Can you please try to install it?
brew install jq
you're right, now it's fine :
...
Installed file /Users/flovntp/.ddev/commands/web/platform
Downloaded add-on platformsh/ddev-platformsh, use `ddev restart` to enable.
Please read instructions for this addon at the source repo at
https://github.com/platformsh/ddev-platformsh
Please file issues and create pull requests there to improve it.
However, I didn't know that DDEV required jq
, and if so, it should be marked as a dependency in the Homebrew formula. Did you install it (DDEV itself) with Homebrew or using another way?
homebrew
Could you please report an issue about this on DDEV Homebrew tap? https://github.com/drud/homebrew-ddev/issues
I didn't think there was anything in the current release of this add-on that required jq, but there is.
There's nothing about ddev that requires jq, it's just that this add-on uses it one place. That's a mistake. So no need to fiddle with homebrew tap
This is important to solve, both because we don't want to depend on user configuration, but also because base64
, for example, behaves differently on macOS than on Linux. So we'll need a small docker image or something.
Hi @rfay i can't get my Symfony project to be configured using ddev addon. This is what i get from the command line :
Let me know if you need me to grant you access to this project, it's the SFCon workshop that we will handle with Sylvain.
note: ddev start is just a fail try, to be sure that ddev can't start as it is.