Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update directory name #568

Merged
merged 7 commits into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/cd-to-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
8 changes: 4 additions & 4 deletions .github/workflows/cd-to-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.8'
services:
playground-blue:
image: ${ECR_REPO}
image: ${PLAYGROUND_ECR_REPO}
expose:
- 8080
ports:
Expand All @@ -11,7 +11,7 @@ services:
- SPRING_PROFILES_ACTIVE=${SPRING_PROFILES_ACTIVE}

playground-green:
image: ${ECR_REPO}
image: ${PLAYGROUND_ECR_REPO}
expose:
- 8080
ports:
Expand Down
8 changes: 4 additions & 4 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
4 changes: 2 additions & 2 deletions scripts/nginx_reload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
}
Loading