Git Product home page Git Product logo

Comments (9)

flovntp avatar flovntp commented on August 17, 2024

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 :

  • first step is to download PSH project, using platform get <IDProject>
  • run ddev config
  • then we can use the command 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 :

  • if ddev get platformsh/ddev-platformsh and there is no config.yaml file --> ask to user if we need to execute it?
  • if config.yaml exists but no sources exists in the current folder (no .platform.app.yaml file) --> ask the user to download the project using 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

from ddev-platformsh.

flovntp avatar flovntp commented on August 17, 2024

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.

from ddev-platformsh.

lolautruche avatar lolautruche commented on August 17, 2024

It's probably because you don't have jq locally. Can you please try to install it?
brew install jq

from ddev-platformsh.

flovntp avatar flovntp commented on August 17, 2024

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. 

from ddev-platformsh.

lolautruche avatar lolautruche commented on August 17, 2024

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?

from ddev-platformsh.

flovntp avatar flovntp commented on August 17, 2024

homebrew

from ddev-platformsh.

lolautruche avatar lolautruche commented on August 17, 2024

Could you please report an issue about this on DDEV Homebrew tap?
https://github.com/drud/homebrew-ddev/issues

from ddev-platformsh.

rfay avatar rfay commented on August 17, 2024

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

from ddev-platformsh.

rfay avatar rfay commented on August 17, 2024

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.

from ddev-platformsh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.