Skip to content

Commit fa6f670

Browse files
PierreGauthierbotisSmile
authored andcommitted
[Deploy] Add parameter for sample data in deploy script
1 parent 0e2740d commit fa6f670

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
last_published_version: 2.0.0
3232
back_version_is_tag: false
3333
front_version_is_tag: false
34+
add_sample_data: false
3435
secrets:
3536
AWS_DEPLOY_KEY: ${{ secrets.AWS_DEPLOY_KEY }}
3637
AWS_HOSTNAME: ${{ secrets.AWS_HOSTNAME_DEMO_ORO }}

.github/workflows/deploy-int.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ on:
2222
required: false
2323
default: false
2424
type: boolean
25+
add_sample_data:
26+
description: "Install sample data"
27+
required: false
28+
default: true
29+
type: boolean
2530
secrets:
2631
AWS_DEPLOY_KEY:
2732
required: true
@@ -51,6 +56,7 @@ jobs:
5156
back_branch: ${{ inputs.back_version_is_tag == true && format('tags/{0}', inputs.version) || format('origin/{0}', inputs.version) }}
5257
front_branch: ${{ inputs.version == 'master' && 'origin/main' || inputs.front_version_is_tag == true && format('tags/v{0}', inputs.version) || format('origin/{0}', inputs.version) }}
5358
composer_version: ${{ inputs.version == 'master' && 'dev-master' || (contains(inputs.version, 'x') && format('{0}-dev', inputs.version) || inputs.version) }}
59+
add_sample_data: ${{ inputs.add_sample_data }}
5460
PRIVATE_KEY: ${{ secrets.AWS_DEPLOY_KEY }}
5561
HOSTNAME : ${{ secrets.AWS_HOSTNAME }}
5662
USER_NAME : ${{ secrets.AWS_USER }}
@@ -69,9 +75,9 @@ jobs:
6975
([[ $(docker volume ls -q | awk '!/_/' | wc -l) -eq 0 ]] || docker volume rm $(docker volume ls -q | awk '!/_/' | tr '\n' ' ')) &&
7076
make .env &&
7177
POSTGRES_PASSWORD=$POSTGRES_PASSWORD docker compose -f compose.yml -f compose.int.yml up -d database &&
72-
POSTGRES_PASSWORD=$POSTGRES_PASSWORD docker compose -f compose.yml run --rm bin/console lexik:jwt:generate-keypair --skip-if-exists &&
78+
POSTGRES_PASSWORD=$POSTGRES_PASSWORD docker compose -f compose.yml run --rm php bin/console lexik:jwt:generate-keypair --skip-if-exists &&
7379
docker compose -f compose.yml -f compose.int.yml down &&
74-
git fetch --all && git reset --hard && git checkout ${{ env.back_branch }} &&
80+
git fetch --all && git reset --hard && git checkout ${{ env.back_branch }} &&
7581
[ -d front/gally-admin ] || git clone https://github.com/Elastic-Suite/gally-admin.git front/gally-admin &&
7682
cd front/gally-admin && git fetch --all && git reset --hard && git checkout ${{ env.front_branch }} &&
7783
cd /home/ubuntu/gally &&
@@ -83,7 +89,10 @@ jobs:
8389
docker compose run --rm php composer config repositories.gally-premium composer $PACKAGIST_URL &&
8490
docker compose run --rm -e COMPOSER_AUTH='$COMPOSER_AUTH' php composer require \"gally/gally-standard:${{ env.composer_version }} as ${{ inputs.last_published_version }}\" &&
8591
docker compose run --rm -e COMPOSER_AUTH='$COMPOSER_AUTH' php composer require \"gally/gally-premium:${{ env.composer_version }}\" &&
86-
docker compose run --rm -e COMPOSER_AUTH='$COMPOSER_AUTH' php composer require \"gally/gally-sample-data:${{ env.composer_version }}\" &&
92+
echo \"Sample data value: ${{ env.add_sample_data }}\" &&
93+
[ \"${{ env.add_sample_data }}\" = false ] || echo \"Install sample data\"
94+
[ \"${{ env.add_sample_data }}\" = false ] || docker compose run --rm -e COMPOSER_AUTH='$COMPOSER_AUTH' php composer require \"gally/gally-sample-data:${{ env.composer_version }}\" &&
95+
[ \"${{ env.add_sample_data }}\" = true ] || docker compose run --rm -e COMPOSER_AUTH='$COMPOSER_AUTH' php composer require \"doctrine/doctrine-fixtures-bundle\":\"^3.4\" &&
8796
docker compose run --rm php sed -i \"s/DoctrineFixturesBundle::class => \['dev' => true, 'test' => true]/DoctrineFixturesBundle::class => ['all' => true]/g\" config/bundles.php &&
8897
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
8998
"

0 commit comments

Comments
 (0)