diff --git a/.github/workflows/cd-to-dev.yml b/.github/workflows/cd-to-dev.yml index df29c264..c77d1ed0 100644 --- a/.github/workflows/cd-to-dev.yml +++ b/.github/workflows/cd-to-dev.yml @@ -85,7 +85,7 @@ jobs: username: ${{ secrets.RELEASE_SERVER_USER }} key: ${{ secrets.DEV_RELEASE_SERVER_KEY }} source: "./docker-compose.yml" - target: "/home/ec2-user/app/" + target: "/home/ec2-user/playground/" - name: 'Send deploy script to EC2 Instance' uses: appleboy/scp-action@master @@ -94,7 +94,7 @@ jobs: username: ${{ secrets.RELEASE_SERVER_USER }} key: ${{ secrets.DEV_RELEASE_SERVER_KEY }} source: "./scripts/" - target: "/home/ec2-user/app/" + target: "/home/ec2-user/playground/" - name: 'Get current time' uses: 1466587594/get-current-time@v2 @@ -113,6 +113,6 @@ jobs: script: | cd ~ sudo docker pull $ECR_REPO - sudo chmod +x ./app/scripts/*.sh - ./app/scripts/deploy.sh + sudo chmod +x ./playground/scripts/*.sh + ./playground/scripts/deploy.sh docker image prune -f diff --git a/.github/workflows/cd-to-prod.yml b/.github/workflows/cd-to-prod.yml index 12f8704f..fd3aa97b 100644 --- a/.github/workflows/cd-to-prod.yml +++ b/.github/workflows/cd-to-prod.yml @@ -84,7 +84,7 @@ jobs: username: ${{ secrets.RELEASE_SERVER_USER }} key: ${{ secrets.PROD_RELEASE_SERVER_KEY }} source: "./docker-compose.yml" - target: "/home/ec2-user/app/" + target: "/home/ec2-user/playground/" - name: 'Send deploy script to EC2 Instance' uses: appleboy/scp-action@master @@ -93,7 +93,7 @@ jobs: username: ${{ secrets.RELEASE_SERVER_USER }} key: ${{ secrets.PROD_RELEASE_SERVER_KEY }} source: "./scripts/" - target: "/home/ec2-user/app/" + target: "/home/ec2-user/playground/" - name: 'Get current time' uses: 1466587594/get-current-time@v2 @@ -112,6 +112,6 @@ jobs: script: | cd ~ sudo docker pull $ECR_REPO - sudo chmod +x ./app/scripts/*.sh - ./app/scripts/deploy.sh + sudo chmod +x ./playground/scripts/*.sh + ./playground/scripts/deploy.sh docker image prune -f diff --git a/docker-compose.yml b/docker-compose.yml index f4f3f377..7f7ab734 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.8' services: playground-blue: - image: ${ECR_REPO} + image: ${PLAYGROUND_ECR_REPO} expose: - 8080 ports: @@ -11,7 +11,7 @@ services: - SPRING_PROFILES_ACTIVE=${SPRING_PROFILES_ACTIVE} playground-green: - image: ${ECR_REPO} + image: ${PLAYGROUND_ECR_REPO} expose: - 8080 ports: diff --git a/scripts/deploy.sh b/scripts/deploy.sh index e131cacd..160ba21f 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -2,10 +2,10 @@ cd /home/ec2-user/app # Source the external scripts to load their functions -source /home/ec2-user/app/scripts/health_check.sh -source /home/ec2-user/app/scripts/deploy_container.sh -source /home/ec2-user/app/scripts/nginx_reload.sh -source /home/ec2-user/app/scripts/stop_container.sh +source /home/ec2-user/playground/scripts/health_check.sh +source /home/ec2-user/playground/scripts/deploy_container.sh +source /home/ec2-user/playground/scripts/nginx_reload.sh +source /home/ec2-user/playground/scripts/stop_container.sh ALL_PORTS=("8080","8081") diff --git a/scripts/nginx_reload.sh b/scripts/nginx_reload.sh index 03bcf196..91bccb3d 100644 --- a/scripts/nginx_reload.sh +++ b/scripts/nginx_reload.sh @@ -6,7 +6,7 @@ reload_nginx() { echo "▶️ Nginx Reload (Port switching applied) ..." - echo "set \$service_url http://127.0.0.1:${PORT};" | sudo tee /etc/nginx/conf.d/service-url.inc + echo "set \$service_url http://127.0.0.1:${PORT};" | sudo tee /etc/nginx/conf.d/playground-url.inc sudo nginx -s reload - echo "Current running Port after switching: $(sudo cat /etc/nginx/conf.d/service-url.inc)" + echo "Current running Port after switching: $(sudo cat /etc/nginx/conf.d/playground-url.inc)" }