Skip to content

Commit ad801d3

Browse files
committed
Fix delivery workflow, add paréntesis on OR conditions to avoid the skipping of errors in AND conditions and move 'generate-keypair' to the end to avoid building of a wrong Docker images
1 parent 1ff2988 commit ad801d3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

.github/workflows/deploy-int.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,15 @@ jobs:
6969
echo "$PRIVATE_KEY" > private_key && chmod 600 private_key
7070
ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=30 -i private_key ${USER_NAME}@${HOSTNAME} "
7171
cd /home/ubuntu/ &&
72-
[ -d gally ] || git clone https://github.com/Elastic-Suite/gally.git gally &&
72+
([ -d gally ] || git clone https://github.com/Elastic-Suite/gally.git gally) &&
7373
cd /home/ubuntu/gally &&
7474
docker system prune -af &&
7575
([[ $(docker volume ls -q | awk '!/_/' | wc -l) -eq 0 ]] || docker volume rm $(docker volume ls -q | awk '!/_/' | tr '\n' ' ')) &&
7676
make .env &&
77-
POSTGRES_PASSWORD=$POSTGRES_PASSWORD docker compose -f compose.yml -f compose.int.yml up -d database &&
78-
POSTGRES_PASSWORD=$POSTGRES_PASSWORD docker compose -f compose.yml run --rm php bin/console lexik:jwt:generate-keypair --skip-if-exists &&
77+
POSTGRES_PASSWORD=$POSTGRES_PASSWORD docker compose -f compose.yml -f compose.int.yml up -d database &&
7978
docker compose -f compose.yml -f compose.int.yml down &&
8079
git fetch --all && git reset --hard && git checkout ${{ env.back_branch }} &&
81-
[ -d front/gally-admin ] || git clone https://github.com/Elastic-Suite/gally-admin.git front/gally-admin &&
80+
([ -d front/gally-admin ] || git clone https://github.com/Elastic-Suite/gally-admin.git front/gally-admin) &&
8281
cd front/gally-admin && git fetch --all && git reset --hard && git checkout ${{ env.front_branch }} &&
8382
cd /home/ubuntu/gally &&
8483
SERVER_NAME=$HOSTNAME docker compose -f compose.init_certs.yml build &&
@@ -90,9 +89,10 @@ jobs:
9089
docker compose run --rm -e COMPOSER_AUTH='$COMPOSER_AUTH' php composer require \"gally/gally-standard:${{ env.composer_version }} as ${{ inputs.last_published_version }}\" &&
9190
docker compose run --rm -e COMPOSER_AUTH='$COMPOSER_AUTH' php composer require \"gally/gally-premium:${{ env.composer_version }}\" &&
9291
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\" &&
92+
([ \"${{ env.add_sample_data }}\" = false ] || echo \"Install sample data\") &&
93+
([ \"${{ env.add_sample_data }}\" = false ] || docker compose run --rm -e COMPOSER_AUTH='$COMPOSER_AUTH' php composer require \"gally/gally-sample-data:${{ env.composer_version }}\") &&
94+
([ \"${{ env.add_sample_data }}\" = true ] || docker compose run --rm -e COMPOSER_AUTH='$COMPOSER_AUTH' php composer require \"doctrine/doctrine-fixtures-bundle\":\"^3.4\") &&
9695
docker compose run --rm php sed -i \"s/DoctrineFixturesBundle::class => \['dev' => true, 'test' => true]/DoctrineFixturesBundle::class => ['all' => true]/g\" config/bundles.php &&
97-
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
96+
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 &&
97+
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
9898
"

0 commit comments

Comments
 (0)