Skip to content

Commit

Permalink
Add deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreGauthier committed May 31, 2024
1 parent fbbd715 commit da0eff1
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 6 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy demo

on:
workflow_dispatch:

jobs:
deploy-demo:
name: Deploy demo
runs-on: ubuntu-latest
if: always()
steps:
- name: Deploy in EC2
env:
BRANCH: ${{ format('origin/{0}', github.ref_name) }}
PRIVATE_KEY: ${{ secrets.AWS_DEPLOY_KEY }}
HOSTNAME : ${{ secrets.AWS_HOSTNAME }}
USER_NAME : ${{ secrets.AWS_USER }}
run: |
echo "$PRIVATE_KEY" > private_key && chmod 600 private_key
ssh -o StrictHostKeyChecking=no -i private_key ${USER_NAME}@${HOSTNAME} "
cd /home/ubuntu/ &&
[ -d shopware ] || git clone https://github.com/Elastic-Suite/shopware-demo.git shopware &&
cd /home/ubuntu/shopware &&
[ -d plugins/GallyPlugin ] || git clone https://github.com/Elastic-Suite/gally-shopware-connector.git plugins/GallyPlugin &&
docker system prune -af &&
([[ $(docker volume ls -q | awk '!/_/' | wc -l) -eq 0 ]] || docker volume rm $(docker volume ls -q | awk '!/_/' | tr '\n' ' ')) &&
docker compose down &&
git fetch --all && git reset --hard && git checkout ${{ env.BRANCH }} &&
cd /home/ubuntu/shopware/plugins/GallyPlugin &&
git fetch --all && git reset --hard && git checkout ${{ env.BRANCH }} &&
cd /home/ubuntu/shopware &&
docker compose -f compose.yml up -d --build
"
8 changes: 8 additions & 0 deletions compose.override.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
services:
shopware:
ports:
- "8082:80"
- "3308:3306"
environment:
- XDEBUG_ENABLED=1
- XDEBUG_REMOTE_HOST=172.17.0.1

networks:
default:
Expand Down
7 changes: 1 addition & 6 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
version: "3"

services:
shopware:
image: dockware/dev:6.6.2.0
ports:
- "8082:80"
- "3308:3306"
- "443:443"
volumes:
- ./plugins:/var/www/html/custom/plugins:rw,cached
- db_data:/var/lib/mysql
environment:
- XDEBUG_ENABLED=1
- XDEBUG_REMOTE_HOST=172.17.0.1

volumes:
db_data:

0 comments on commit da0eff1

Please sign in to comment.