@@ -25,17 +25,18 @@ Prepare Your Application
25
25
26
26
To deploy your Symfony application on Platform.sh, you simply need to add a
27
27
``.platform.app.yaml `` at the root of your Git repository which will tell
28
- Platform.sh how to deploy your application (read more about ` Platform.sh
29
- configuration files `_).
28
+ Platform.sh how to deploy your application (read more about
29
+ ` Platform.sh configuration files `_).
30
30
31
31
.. code-block :: yaml
32
32
33
33
# .platform.app.yaml
34
+
34
35
# This file describes an application. You can have multiple applications
35
36
# in the same project.
36
37
37
38
# The name of this app. Must be unique within a project.
38
- name : php
39
+ name : myphpproject
39
40
40
41
# The toolstack used to build the application.
41
42
toolstack : " php:symfony"
@@ -98,27 +99,27 @@ following file:
98
99
99
100
.. code-block :: php
100
101
101
- # app/config/parameters_platform.php
102
+ // app/config/parameters_platform.php
102
103
<?php
103
104
$relationships = getenv("PLATFORM_RELATIONSHIPS");
104
- if (!$relationships) {
105
- return;
105
+ if (!$relationships) {
106
+ return;
106
107
}
107
108
108
- $relationships = json_decode(base64_decode($relationships), TRUE );
109
+ $relationships = json_decode(base64_decode($relationships), true );
109
110
110
111
foreach ($relationships['database'] as $endpoint) {
111
- if (empty($endpoint['query']['is_master'])) {
112
- continue;
113
- }
114
-
115
- $container->setParameter('database_driver', 'pdo_' . $endpoint['scheme']);
116
- $container->setParameter('database_host', $endpoint['host']);
117
- $container->setParameter('database_port', $endpoint['port']);
118
- $container->setParameter('database_name', $endpoint['path']);
119
- $container->setParameter('database_user', $endpoint['username']);
120
- $container->setParameter('database_password', $endpoint['password']);
121
- $container->setParameter('database_path', '');
112
+ if (empty($endpoint['query']['is_master'])) {
113
+ continue;
114
+ }
115
+
116
+ $container->setParameter('database_driver', 'pdo_' . $endpoint['scheme']);
117
+ $container->setParameter('database_host', $endpoint['host']);
118
+ $container->setParameter('database_port', $endpoint['port']);
119
+ $container->setParameter('database_name', $endpoint['path']);
120
+ $container->setParameter('database_user', $endpoint['username']);
121
+ $container->setParameter('database_password', $endpoint['password']);
122
+ $container->setParameter('database_path', '');
122
123
}
123
124
124
125
# Store session into /tmp.
@@ -140,11 +141,12 @@ command that you see on the Platform.sh web UI):
140
141
141
142
.. code-block :: bash
142
143
143
- $ git remote add platform [PROJECT-ID]@git.[CLUSTER].platform.sh:[PROJECT].git
144
-
144
+ $ git remote add platform [PROJECT-ID]@git.[CLUSTER].platform.sh:[PROJECT-ID].git
145
145
146
- * PROJECT-ID: Unique identifier of your project. Something like: *kjh43kbobssae *.
147
- * CLUSTER: Server location where your project is deployed. It can be *eu * or *us *.
146
+ ``PROJECT-ID ``
147
+ Unique identifier of your project. Something like ``kjh43kbobssae ``
148
+ ``CLUSTER ``
149
+ Server location where your project is deplyed. It can be ``eu `` or ``us ``
148
150
149
151
Commit the Platform.sh specific files created in the previous section:
150
152
@@ -158,20 +160,7 @@ Push your code base to the newly added remote:
158
160
159
161
.. code-block :: bash
160
162
161
- $ git push -u platform master
162
-
163
- Counting objects: 27, done.
164
- Delta compression using up to 4 threads.
165
- Compressing objects: 100% (11/11), done.
166
- Writing objects: 100% (16/16), 2.47 KiB | 0 bytes/s, done.
167
- Total 16 (delta 7), reused 12 (delta 5)
168
-
169
- Processing activity environment.push
170
- Found 213 new commits.
171
-
172
- Building application ' php' with toolstack ' php:symfony' (tree: 2248cf8)
173
- Found a ` composer.json` , installing dependencies.
174
- ...
163
+ $ git push platform master
175
164
176
165
That's it! Your application is being deployed on Platform.sh and you'll soon be
177
166
able to access it in your browser.
0 commit comments