Merge branch '1.5' into 1.6

* 1.5:
  [Docs] Pltform.sh cookbook refinement
This commit is contained in:
Grzegorz Sadowski 2019-12-13 13:32:36 +01:00
commit 52bc8fcc1c
No known key found for this signature in database
GPG key ID: EF87FF4E6E3BD364
2 changed files with 31 additions and 37 deletions

View file

@ -1,4 +1,3 @@
How to deploy Sylius to Platform.sh?
====================================
@ -13,15 +12,15 @@ In this guide you will find sufficient instructions to have your application up
1. Prepare a Platform.sh project
--------------------------------
* Create an account on `Platform.sh <https://platform.sh/>`_
* Create an account on `Platform.sh <https://platform.sh/>`_.
* Create a new project, naming it **MyFirstShop** and selecting **Blank project** template
* Create a new project, name it (**MyFirstShop** for example) and select the **Blank project** template.
.. hint::
**Platform.sh** offers a trial month, which you can use for testing your store deployment. If you would be asked to provide
your credit card data nevertheless, use `this link <https://accounts.platform.sh/platform/trial/general/setup>`_ for a new
project creation.
**Platform.sh** offers a trial month, which you can use for testing your store deployment. If you would be asked to
provide your credit card data nevertheless, use `this link <https://accounts.platform.sh/platform/trial/general/setup>`_
to create your new project.
.. image:: /_images/getting-started-with-sylius/platform-sh-project.png
:scale: 55%
@ -29,12 +28,12 @@ In this guide you will find sufficient instructions to have your application up
|
* Install a Symfony-Platform.sh bridge in your application with ``composer require platformsh/symfonyflex-bridge``
* Install the Symfony-Platform.sh bridge in your application with ``composer require platformsh/symfonyflex-bridge``.
2. Make the application ready to deploy
---------------------------------------
* Create a file ``.platform/routes.yaml``, which describes how an incoming URL is going to be processed by the server
* Create the ``.platform/routes.yaml`` file, which describes how an incoming URL is going to be processed by the server.
.. code-block:: yaml
@ -46,7 +45,7 @@ In this guide you will find sufficient instructions to have your application up
type: redirect
to: "https://{default}/"
* Create a file ``.platform/services.yaml``
* Create the ``.platform/services.yaml`` file.
.. code-block:: yaml
@ -54,7 +53,7 @@ In this guide you will find sufficient instructions to have your application up
type: mysql:10.2
disk: 2048
* Create a file ``.platform.app.yaml``, which is the main server application configuration file (and the longest one :))
* Create the ``.platform.app.yaml`` file, which is the main server application configuration file (and the longest one 😉).
.. code-block:: yaml
@ -89,7 +88,7 @@ In this guide you will find sufficient instructions to have your application up
# to the application in the PLATFORM_RELATIONSHIPS variable. The right-hand
# side is in the form `<service name>:<endpoint name>`.
relationships:
# behind the scene this will be installed mariadb because platform.sh use it instead mysql
# NOTE: this will install mariadb because platform.sh uses it instead of mysql.
database: "db:mysql"
dependencies:
@ -151,10 +150,13 @@ In this guide you will find sufficient instructions to have your application up
.. warning::
It is important to place newly created file after importing regular parameters.yml file. Otherwise your database connection will not work.
Also this will be the file where you should set your required parameters. Its value will be fetched from environmental variables.
It is important to place the newly created file after importing regular parameters.yml file. Otherwise your database
connection will not work. Also this will be the file where you should set your required parameters. Its value will
be fetched from environmental variables.
The application secret is used in several places in Sylius and Symfony. Platform.sh allows you to deploy an environment for each branch you have, and therefore it makes sense to have a secret automatically generated by the Platform.sh system. The last 3 lines in the sample above will use the Platform.sh-provided random value as the application secret.
The application secret is used in several places in Sylius and Symfony. Platform.sh allows you to deploy an environment
for each branch you have, and therefore it makes sense to have a secret automatically generated by the Platform.sh system.
The last 3 lines in the sample above will use the Platform.sh-provided random value as the application secret.
3. Add Platform.sh as a remote to your repository
-------------------------------------------------
@ -171,10 +173,12 @@ and ``CLUSTER`` can be ``eu`` or ``us`` - depending on where are you deploying y
4. Commit the configuration
---------------------------
Use ``git add . && git commit -m "Platform.sh configuration"``
.. code-block:: bash
5. Push your project to the platform remote
-------------------------------------------
$ git add . && git commit -m "Platform.sh configuration"
5. Push your project to the Platform.sh remote repository
---------------------------------------------------------
.. code-block:: bash
@ -185,7 +189,8 @@ The output of this command shows you on which URL your online store can be acces
6. Connect to the project via SSH and install Sylius
----------------------------------------------------
The SSH command can be found in your project data on Platform.sh. Alternatively use the `Platform CLI tool <https://docs.platform.sh/gettingstarted/cli.html>`_.
The SSH command can be found in your project data on Platform.sh. Alternatively use the
`Platform CLI tool <https://docs.platform.sh/gettingstarted/cli.html>`_.
When you get connected please run:
@ -195,7 +200,7 @@ When you get connected please run:
.. warning::
By default platform.sh creates only one instance of a database with the `main` name.
By default platform.sh creates only one instance of the database with the ``main`` name.
Platform.sh works with the concept of an environment per branch if activated. The idea is to mimic production settings per each branch.
7. Dive deeper
@ -219,15 +224,15 @@ Add the example below to your ``.platform.app.yaml`` file. This runs these cronj
Additional tips:
~~~~~~~~~~~~~~~~
* Platform.sh can serve gzipped versions of your static assets. Make sure to save your assets in the same folder, but with
a .gz suffix. The ``gulp-gzip`` node package comes very helpful integrating saving of .gz versions of your assets.
* Platform.sh can serve gzipped versions of your static assets. Make sure to save your assets in the same folder, but with a .gz suffix.
The ``gulp-gzip`` node package comes very helpful integrating saving of .gz versions of your assets.
* Platform.sh comes with a `New Relic integration <https://docs.platform.sh/administration/integrations/new-relic.html>`_.
* Platform.sh comes with a `Blackfire.io integration <https://docs.platform.sh/administration/integrations/blackfire.html>`_
Learn more
~~~~~~~~~~~
----------
* Platform.sh documentation: `Configuring Symfony projects for Platform.sh <https://docs.platform.sh/frameworks/symfony.html>`_
* Symfony documentation: `Deploying Symfony to Platform.sh <http://symfony.com/doc/current/deployment/platformsh.html>`_

View file

@ -3,21 +3,10 @@ Deployment
Development usually takes most of the time in project implementation, but we should not forget about what's at the end of this process -
application deployment into the server. We believe, that it should be as easy and understandable as possible.
There are many servers which you can choose for your store deployment, but in this chapter, we will use `Platform.sh <https://platform.sh/>`_.
There are many servers which you can choose for your store deployment: in our documentation you will find an easy Platform.sh guide.
.. attention::
Check it out!
To deploy your application to the proposed server, you need to have a git repository configured.
.. tip::
Process
-------
For example there is configuration for Platform.sh : :doc:`Deployment platform.sh </cookbook/deployment/platform-sh>`
You have also a URL provided, which you can visit to see if your shop working well. Of course, it does not have your configuration
done locally, as well as your product... but you have an application deployed! Congratulations! You've just finished the first
stage of the first project with Sylius.
.. important::
Of course, using the **Platform.sh** is only an example. You can use any server you want or you're familiar with.
👉 :doc:`How to deploy Sylius to Platform.sh? </cookbook/deployment/platform-sh>`