Skip to content

Commit e4f7bf6

Browse files
wiewiurdpMateuszKolankowski
andauthored
IBX-9942: Updated deployment process to use Symfony Cloud configurator and symfony-deploy (#92)
* Updated deployment process to use Symfony Cloud configurator and symfony-deploy * Removing deprecated method usage --------- Co-authored-by: MateuszKolankowski <wiewiurdp@tlen. pl>
1 parent 3cd2c02 commit e4f7bf6

File tree

5 files changed

+38
-9
lines changed

5 files changed

+38
-9
lines changed

resources/platformsh/ibexa-commerce/5.0/.platform.app.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,17 @@ hooks:
161161
echo "TIP: If you need to authenticate against Github/Gitlab/updates.ibexa.co, use COMPOSER_AUTH env variable"
162162
echo "See: https://docs.platform.sh/guides/general/composer-auth.html#set-the-envcomposer_auth-project-variable"
163163
fi
164-
165-
composer install --no-dev --prefer-dist --no-progress --no-interaction --optimize-autoloader
164+
165+
curl -fs https://get.symfony.com/cloud/configurator | bash
166+
167+
NODE_VERSION=v18.19.0 symfony-build
166168
167169
# Deploy hook, access to services & done once (per cluster, not per node), only mounts are writable at this point
168170
# Note: Http traffic is paused while this is running, so for prod code this should finish as fast as possible, < 30s
169171
deploy: |
170172
set -e
173+
174+
symfony-deploy
171175
172176
if [ ! -f public/var/.platform.installed ]; then
173177
# Configure ElasticSearch mappings

resources/platformsh/ibexa-experience/5.0/.platform.app.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,17 @@ hooks:
161161
echo "TIP: If you need to authenticate against Github/Gitlab/updates.ibexa.co, use COMPOSER_AUTH env variable"
162162
echo "See: https://docs.platform.sh/guides/general/composer-auth.html#set-the-envcomposer_auth-project-variable"
163163
fi
164-
165-
composer install --no-dev --prefer-dist --no-progress --no-interaction --optimize-autoloader
164+
165+
curl -fs https://get.symfony.com/cloud/configurator | bash
166+
167+
NODE_VERSION=v18.19.0 symfony-build
166168
167169
# Deploy hook, access to services & done once (per cluster, not per node), only mounts are writable at this point
168170
# Note: Http traffic is paused while this is running, so for prod code this should finish as fast as possible, < 30s
169171
deploy: |
170172
set -e
173+
174+
symfony-deploy
171175
172176
if [ ! -f public/var/.platform.installed ]; then
173177
# Configure ElasticSearch mappings

resources/platformsh/ibexa-headless/5.0/.platform.app.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,17 @@ hooks:
161161
echo "TIP: If you need to authenticate against Github/Gitlab/updates.ibexa.co, use COMPOSER_AUTH env variable"
162162
echo "See: https://docs.platform.sh/guides/general/composer-auth.html#set-the-envcomposer_auth-project-variable"
163163
fi
164-
165-
composer install --no-dev --prefer-dist --no-progress --no-interaction --optimize-autoloader
164+
165+
curl -fs https://get.symfony.com/cloud/configurator | bash
166+
167+
NODE_VERSION=v18.19.0 symfony-build
166168
167169
# Deploy hook, access to services & done once (per cluster, not per node), only mounts are writable at this point
168170
# Note: Http traffic is paused while this is running, so for prod code this should finish as fast as possible, < 30s
169171
deploy: |
170172
set -e
173+
174+
symfony-deploy
171175
172176
if [ ! -f public/var/.platform.installed ]; then
173177
# Configure ElasticSearch mappings

resources/platformsh/ibexa-oss/5.0/.platform.app.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,17 @@ hooks:
158158
echo "TIP: If you need to authenticate against Github/Gitlab/updates.ibexa.co, use COMPOSER_AUTH env variable"
159159
echo "See: https://docs.platform.sh/guides/general/composer-auth.html#set-the-envcomposer_auth-project-variable"
160160
fi
161-
162-
composer install --no-dev --prefer-dist --no-progress --no-interaction --optimize-autoloader
161+
162+
curl -fs https://get.symfony.com/cloud/configurator | bash
163+
164+
NODE_VERSION=v18.19.0 symfony-build
163165
164166
# Deploy hook, access to services & done once (per cluster, not per node), only mounts are writable at this point
165167
# Note: Http traffic is paused while this is running, so for prod code this should finish as fast as possible, < 30s
166168
deploy: |
167169
set -e
170+
171+
symfony-deploy
168172
169173
if [ ! -f public/var/.platform.installed ]; then
170174
# To workaround issues with p.sh Varnish we clear container cache & temporary set Symfony Proxy

src/lib/Command/IbexaSetupCommand.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,20 @@ static function (SplFileInfo $dir): string {
172172
)
173173
);
174174

175-
$productPackage = InstalledVersions::getRawData()['versions'][$product];
175+
$allRawDataSets = InstalledVersions::getAllRawData();
176+
$productPackage = null;
177+
178+
foreach ($allRawDataSets as $rawData) {
179+
if (isset($rawData['versions'][$product])) {
180+
$productPackage = $rawData['versions'][$product];
181+
break;
182+
}
183+
}
184+
185+
if ($productPackage === null) {
186+
throw new RuntimeException(sprintf('Could not find product "%s" in installed versions.', $product));
187+
}
188+
176189
$aliases = $productPackage['aliases'] ?? [];
177190
$productVersion = $productPackage['version'] ?? '';
178191

0 commit comments

Comments
 (0)