Skip to content

Commit 95b6b9d

Browse files
[CI] Fix deploy script when sample data are not installed
1 parent 09d51b8 commit 95b6b9d

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

.github/workflows/deploy-demo-shopware.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
with:
3030
version: ${{ github.ref_name }}
3131
last_published_version: 2.2.1
32+
add_sample_data: false
3233
secrets:
3334
AWS_DEPLOY_KEY: ${{ secrets.AWS_DEPLOY_KEY }}
3435
AWS_HOSTNAME: ${{ secrets.AWS_HOSTNAME_DEMO_SHOPWARE }}

.github/workflows/deploy-demo-sylius.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
with:
3030
version: ${{ github.ref_name }}
3131
last_published_version: 2.2.1
32+
add_sample_data: false
3233
secrets:
3334
AWS_DEPLOY_KEY: ${{ secrets.AWS_DEPLOY_KEY }}
3435
AWS_HOSTNAME: ${{ secrets.AWS_HOSTNAME_DEMO_SYLIUS }}

.github/workflows/deploy-int.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,15 @@ jobs:
9191
docker compose run --rm php composer config repositories.gally-premium composer $PACKAGIST_URL &&
9292
docker compose run --rm -e COMPOSER_AUTH='$COMPOSER_AUTH' php composer require \"gally/gally-standard:${{ env.composer_version }} as ${{ inputs.last_published_version }}\" &&
9393
docker compose run --rm -e COMPOSER_AUTH='$COMPOSER_AUTH' php composer require \"gally/gally-premium:${{ env.composer_version }}\" &&
94-
echo \"Sample data value: ${{ env.add_sample_data }}\" &&
95-
([ \"${{ env.add_sample_data }}\" = false ] || echo \"Install sample data\") &&
96-
([ \"${{ env.add_sample_data }}\" = false ] || docker compose run --rm -e COMPOSER_AUTH='$COMPOSER_AUTH' php composer require \"gally/gally-sample-data:${{ env.composer_version }}\") &&
97-
([ \"${{ env.add_sample_data }}\" = true ] || docker compose run --rm -e COMPOSER_AUTH='$COMPOSER_AUTH' php composer require \"doctrine/doctrine-fixtures-bundle\":\"^3.4\") &&
98-
docker compose run --rm php sed -i \"s/DoctrineFixturesBundle::class => \['dev' => true, 'test' => true]/DoctrineFixturesBundle::class => ['all' => true]/g\" config/bundles.php &&
99-
docker compose run --rm php sed -i \"s/NelmioAliceBundle::class => \['dev' => true, 'test' => true]/NelmioAliceBundle::class => ['all' => true]/g\" config/bundles.php &&
100-
docker compose run --rm php sed -i \"s/FidryAliceDataFixturesBundle::class => \['dev' => true, 'test' => true]/FidryAliceDataFixturesBundle::class => ['all' => true]/g\" config/bundles.php &&
101-
docker compose run --rm php sed -i \"s/HautelookAliceBundle::class => \['dev' => true, 'test' => true]/HautelookAliceBundle::class => ['all' => true]/g\" config/bundles.php &&
94+
echo "Sample data value: ${{ env.add_sample_data }}" &&
95+
if [ "${{ env.add_sample_data }}" = "true" ]; then
96+
echo "Install sample data";
97+
docker compose run --rm -e COMPOSER_AUTH='$COMPOSER_AUTH' php composer require \"gally/gally-sample-data:${{ env.composer_version }}\";
98+
docker compose run --rm php sed -i \"s/DoctrineFixturesBundle::class => \['dev' => true, 'test' => true]/DoctrineFixturesBundle::class => ['all' => true]/g\" config/bundles.php &&
99+
docker compose run --rm php sed -i \"s/NelmioAliceBundle::class => \['dev' => true, 'test' => true]/NelmioAliceBundle::class => ['all' => true]/g\" config/bundles.php &&
100+
docker compose run --rm php sed -i \"s/FidryAliceDataFixturesBundle::class => \['dev' => true, 'test' => true]/FidryAliceDataFixturesBundle::class => ['all' => true]/g\" config/bundles.php &&
101+
docker compose run --rm php sed -i \"s/HautelookAliceBundle::class => \['dev' => true, 'test' => true]/HautelookAliceBundle::class => ['all' => true]/g\" config/bundles.php &&
102+
fi &&
102103
GALLY_DEFAULT_SENDER_NAME='${GALLY_DEFAULT_SENDER_NAME}' GALLY_DEFAULT_SENDER_EMAIL='${GALLY_DEFAULT_SENDER_EMAIL}' MAILER_DSN='${MAILER_DSN}' GALLY_CATALOG_MEDIA_URL=${MEDIA_URL} SERVER_NAME=$HOSTNAME API_ROUTE_PREFIX=api APP_SECRET=$APP_SECRET POSTGRES_PASSWORD=$POSTGRES_PASSWORD COMPOSER_AUTH='$COMPOSER_AUTH' docker compose -f compose.yml -f compose.int.yml up -d --build &&
103104
GALLY_DEFAULT_SENDER_NAME='${GALLY_DEFAULT_SENDER_NAME}' GALLY_DEFAULT_SENDER_EMAIL='${GALLY_DEFAULT_SENDER_EMAIL}' MAILER_DSN='${MAILER_DSN}' GALLY_CATALOG_MEDIA_URL=${MEDIA_URL} SERVER_NAME=$HOSTNAME API_ROUTE_PREFIX=api APP_SECRET=$APP_SECRET POSTGRES_PASSWORD=$POSTGRES_PASSWORD COMPOSER_AUTH='$COMPOSER_AUTH' docker compose -f compose.yml -f compose.int.yml exec php bin/console lexik:jwt:generate-keypair --skip-if-exists
104105
"

0 commit comments

Comments
 (0)