Skip to content

Commit

Permalink
Fix override script, and update DB content to enable SSL when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
jolelievre committed Sep 27, 2023
1 parent ba372ba commit 4f272cb
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/upgrade-shop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit 4f272cb

Please sign in to comment.