From 4f272cb59277e4502dedf0ee7fa90cc90f2da80f Mon Sep 17 00:00:00 2001 From: Jonathan Lelievre Date: Wed, 27 Sep 2023 16:17:25 +0200 Subject: [PATCH] Fix override script, and update DB content to enable SSL when needed --- .github/workflows/upgrade-shop.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/upgrade-shop.yml b/.github/workflows/upgrade-shop.yml index 8bc465d2..b3d44377 100644 --- a/.github/workflows/upgrade-shop.yml +++ b/.github/workflows/upgrade-shop.yml @@ -190,13 +190,9 @@ jobs: ps_dir: ${{ env.PS_TARGET }} - name: Override files from target branch - env: - REPLACED_FILES: | - .docker - docker-compose.yml - test/UI run: | - for replacedFile in ${{ env.REPLACED_FILES }}; do + filesToReplace=".docker docker-compose.yml test/UI" + for replacedFile in $filesToReplace; do if test -f ${{ env.PS_DIR }}/$replacedFile; then echo Remove file ${{ env.PS_DIR }}/$replacedFile rm -f ${{ env.PS_DIR }}/$replacedFile @@ -210,12 +206,21 @@ jobs: echo Remove folder ${{ env.PS_DIR }}/$replacedFile rm -fR ${{ env.PS_DIR }}/$replacedFile if test -d ${{ env.PS_TARGET }}/$replacedFile; then - Override with ${{ env.PS_TARGET }}/$replacedFile + echo Override with ${{ env.PS_TARGET }}/$replacedFile cp -R ${{ env.PS_TARGET }}/$replacedFile ${{ env.PS_DIR }}/$replacedFile fi fi done + - name: Enable SSL for upgraded shop ${{ inputs.target_ref }} + if: startsWith(inputs.target_ref, '8.1') || inputs.target_ref == 'develop' + run: + docker exec ${{ env.DOCKER_PREFIX }}_mysql_1 /usr/bin/mysql -u ${{ env.DB_USER }} -p${{ env.DB_PASSWD }} -e "UPDATE ${{ env.DB_PREFIX }}configuration SET `value` = 'localhost:8002' WHERE `name` = 'PS_SHOP_DOMAIN';" + docker exec ${{ env.DOCKER_PREFIX }}_mysql_1 /usr/bin/mysql -u ${{ env.DB_USER }} -p${{ env.DB_PASSWD }} -e "UPDATE ${{ env.DB_PREFIX }}configuration SET `value` = 'localhost:8002' WHERE `name` = 'PS_SHOP_DOMAIN_SSL';" + docker exec ${{ env.DOCKER_PREFIX }}_mysql_1 /usr/bin/mysql -u ${{ env.DB_USER }} -p${{ env.DB_PASSWD }} -e "UPDATE ${{ env.DB_PREFIX }}configuration SET `value` = '0' WHERE `name` = 'PS_SSL_ENABLED';" + docker exec ${{ env.DOCKER_PREFIX }}_mysql_1 /usr/bin/mysql -u ${{ env.DB_USER }} -p${{ env.DB_PASSWD }} -e "UPDATE ${{ env.DB_PREFIX }}configuration SET `value` = '0' WHERE `name` = 'PS_SSL_ENABLED_EVERYWHERE';" + docker exec ${{ env.DOCKER_PREFIX }}_mysql_1 /usr/bin/mysql -u ${{ env.DB_USER }} -p${{ env.DB_PASSWD }} -e "UPDATE ${{ env.DB_PREFIX }}shop_url SET `domain` = 'localhost:8002', `domain_ssl` = 'localhost:8002';" + # Prepare archive contents to share with following jobs - name: Archive shop content if: always()