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 f390ceb
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 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 @@ -216,6 +212,15 @@ jobs:
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 f390ceb

Please sign in to comment.