Skip to content

Updates to Platform.sh deploy instructions #8397

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions deployment/platformsh.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,25 @@ Platform.sh how to deploy your application (read more about
name: myphpproject

# The type of the application to build.
type: php:5.6
type: php:7.1
build:
flavor: symfony
flavor: composer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you change this? symfony is correct

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read somewhere that composer is the new and recommended type for all PHP. Their Symfony template doc use that too: https://docs.platform.sh/frameworks/symfony.html

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to know, thank you @javiereguiluz 👍


# The relationships of the application with services or other applications.
# The left-hand side is the name of the relationship as it will be exposed
# to the application in the PLATFORM_RELATIONSHIPS variable. The right-hand
# side is in the form `<service name>:<endpoint name>`.
relationships:
database: 'mysql:mysql'
database: 'mydatabase:mysql'

# The configuration of app when it is exposed to the web.
web:
# The public directory of the app, relative to its root.
document_root: '/web'
# The front-controller script to send non-static requests to.
passthru: '/app.php'
locations:
'/':
# The public directory of the app, relative to its root.
root: 'web'
# The front-controller script to send non-static requests to.
passthru: '/app.php'

# The size of the persistent disk of the application (in MB).
disk: 2048
Expand All @@ -73,21 +75,21 @@ Platform.sh how to deploy your application (read more about
deploy: |
bin/console --env=prod cache:clear

For best practices, you should also add a ``.platform`` folder at the root of
You also need add a ``.platform`` folder at the root of
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to add

your Git repository which contains the following files:

.. code-block:: yaml

# .platform/routes.yaml
"http://{default}/":
'https://{default}/':
type: upstream
# the first part should be your project name
upstream: 'myphpproject:php'
upstream: 'myphpproject:http'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be:

'https://{default}/':
  type: upstream
  upstream: "myphpproject:http"
'https://www.{default}/':
  type: redirect
  to: "https://{default}/"


.. code-block:: yaml

# .platform/services.yaml
mysql:
mydatabase:
type: mysql
disk: 2048

Expand Down Expand Up @@ -155,7 +157,7 @@ Commit the Platform.sh specific files created in the previous section:

.. code-block:: terminal

$ git add .platform.app.yaml .platform/*
$ git add .platform.app.yaml .platform/*.yaml
$ git add app/config/config.yml app/config/parameters_platform.php
$ git commit -m "Adding Platform.sh configuration files."

Expand Down