forked from Giveth/impact-graph
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating the Zero-Deployment Steps in Pipelines adding consistency
- Loading branch information
Showing
5 changed files
with
226 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,10 +22,23 @@ jobs: | |
docker image prune -a --force | ||
docker compose pull | ||
rollout-deploy-1: | ||
needs: deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: SSH and Redeploy | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.PRODUCTION_HOST }} | ||
username: ${{ secrets.PRODUCTION_USERNAME }} | ||
key: ${{ secrets.PRODUCTION_PRIVATE_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
cd QAcc-BE | ||
## Update each backend service one by one | ||
## First Deployment | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=0 --scale qacc-be-graph-ql2=1 --scale qacc-be-graph-ql3=1 | ||
docker compose up -d --no-deps --scale qacc-be-job1=0 --scale qacc-be-job2=1 --scale qacc-be-job3=1 | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=0 | ||
docker compose up -d --no-deps --scale qacc-be-job1=0 | ||
docker compose up -d | ||
# Wait for qacc-be-graph-ql1 to be healthy (timeout after 5 minutes) | ||
|
@@ -47,9 +60,22 @@ jobs: | |
fi | ||
echo "First deployment phase completed successfully" | ||
rollout-deploy-2: | ||
needs: rollout-deploy-1 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: SSH and Redeploy | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.PRODUCTION_HOST }} | ||
username: ${{ secrets.PRODUCTION_USERNAME }} | ||
key: ${{ secrets.PRODUCTION_PRIVATE_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
cd QAcc-BE | ||
## Second Deployment | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=1 --scale qacc-be-graph-ql2=0 --scale qacc-be-graph-ql3=1 | ||
docker compose up -d --no-deps --scale qacc-be-job1=1 --scale qacc-be-job2=0 --scale qacc-be-job3=1 | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql2=0 | ||
docker compose up -d --no-deps --scale qacc-be-job2=0 | ||
docker compose up -d | ||
# Wait for qacc-be-graph-ql2 to be healthy (timeout after 5 minutes) | ||
|
@@ -71,9 +97,22 @@ jobs: | |
fi | ||
echo "Second deployment phase completed successfully" | ||
rollout-deploy-3: | ||
needs: rollout-deploy-2 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: SSH and Redeploy | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.PRODUCTION_HOST }} | ||
username: ${{ secrets.PRODUCTION_USERNAME }} | ||
key: ${{ secrets.PRODUCTION_PRIVATE_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
cd QAcc-BE | ||
## Third Deployment | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=1 --scale qacc-be-graph-ql2=1 --scale qacc-be-graph-ql3=0 | ||
docker compose up -d --no-deps --scale qacc-be-job1=1 --scale qacc-be-job2=1 --scale qacc-be-job3=0 | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql3=0 | ||
docker compose up -d --no-deps --scale qacc-be-job3=0 | ||
docker compose up -d | ||
# Wait for qacc-be-graph-ql3 to be healthy (timeout after 5 minutes) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,10 +164,23 @@ jobs: | |
docker image prune -a --force | ||
docker compose pull | ||
rollout-deploy-1: | ||
needs: deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: SSH and Redeploy | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.PRODUCTION_HOST }} | ||
username: ${{ secrets.PRODUCTION_USERNAME }} | ||
key: ${{ secrets.PRODUCTION_PRIVATE_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
cd QAcc-BE | ||
## Update each backend service one by one | ||
## First Deployment | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=0 --scale qacc-be-graph-ql2=1 --scale qacc-be-graph-ql3=1 | ||
docker compose up -d --no-deps --scale qacc-be-job1=0 --scale qacc-be-job2=1 --scale qacc-be-job3=1 | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=0 | ||
docker compose up -d --no-deps --scale qacc-be-job1=0 | ||
docker compose up -d | ||
# Wait for qacc-be-graph-ql1 to be healthy (timeout after 5 minutes) | ||
|
@@ -189,9 +202,22 @@ jobs: | |
fi | ||
echo "First deployment phase completed successfully" | ||
rollout-deploy-2: | ||
needs: rollout-deploy-1 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: SSH and Redeploy | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.PRODUCTION_HOST }} | ||
username: ${{ secrets.PRODUCTION_USERNAME }} | ||
key: ${{ secrets.PRODUCTION_PRIVATE_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
cd QAcc-BE | ||
## Second Deployment | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=1 --scale qacc-be-graph-ql2=0 --scale qacc-be-graph-ql3=1 | ||
docker compose up -d --no-deps --scale qacc-be-job1=1 --scale qacc-be-job2=0 --scale qacc-be-job3=1 | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql2=0 | ||
docker compose up -d --no-deps --scale qacc-be-job2=0 | ||
docker compose up -d | ||
# Wait for qacc-be-graph-ql2 to be healthy (timeout after 5 minutes) | ||
|
@@ -213,9 +239,22 @@ jobs: | |
fi | ||
echo "Second deployment phase completed successfully" | ||
rollout-deploy-3: | ||
needs: rollout-deploy-2 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: SSH and Redeploy | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.PRODUCTION_HOST }} | ||
username: ${{ secrets.PRODUCTION_USERNAME }} | ||
key: ${{ secrets.PRODUCTION_PRIVATE_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
cd QAcc-BE | ||
## Third Deployment | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=1 --scale qacc-be-graph-ql2=1 --scale qacc-be-graph-ql3=0 | ||
docker compose up -d --no-deps --scale qacc-be-job1=1 --scale qacc-be-job2=1 --scale qacc-be-job3=0 | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql3=0 | ||
docker compose up -d --no-deps --scale qacc-be-job3=0 | ||
docker compose up -d | ||
# Wait for qacc-be-graph-ql3 to be healthy (timeout after 5 minutes) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,10 +69,23 @@ jobs: | |
docker image prune -a --force | ||
docker compose pull | ||
rollout-deploy-1: | ||
needs: deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: SSH and Redeploy | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.PRODUCTION_HOST }} | ||
username: ${{ secrets.PRODUCTION_USERNAME }} | ||
key: ${{ secrets.PRODUCTION_PRIVATE_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
cd QAcc-BE | ||
## Update each backend service one by one | ||
## First Deployment | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=0 --scale qacc-be-graph-ql2=1 --scale qacc-be-graph-ql3=1 | ||
docker compose up -d --no-deps --scale qacc-be-job1=0 --scale qacc-be-job2=1 --scale qacc-be-job3=1 | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=0 | ||
docker compose up -d --no-deps --scale qacc-be-job1=0 | ||
docker compose up -d | ||
# Wait for qacc-be-graph-ql1 to be healthy (timeout after 5 minutes) | ||
|
@@ -94,9 +107,22 @@ jobs: | |
fi | ||
echo "First deployment phase completed successfully" | ||
rollout-deploy-2: | ||
needs: rollout-deploy-1 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: SSH and Redeploy | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.PRODUCTION_HOST }} | ||
username: ${{ secrets.PRODUCTION_USERNAME }} | ||
key: ${{ secrets.PRODUCTION_PRIVATE_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
cd QAcc-BE | ||
## Second Deployment | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=1 --scale qacc-be-graph-ql2=0 --scale qacc-be-graph-ql3=1 | ||
docker compose up -d --no-deps --scale qacc-be-job1=1 --scale qacc-be-job2=0 --scale qacc-be-job3=1 | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql2=0 | ||
docker compose up -d --no-deps --scale qacc-be-job2=0 | ||
docker compose up -d | ||
# Wait for qacc-be-graph-ql2 to be healthy (timeout after 5 minutes) | ||
|
@@ -118,9 +144,22 @@ jobs: | |
fi | ||
echo "Second deployment phase completed successfully" | ||
rollout-deploy-3: | ||
needs: rollout-deploy-2 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: SSH and Redeploy | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.PRODUCTION_HOST }} | ||
username: ${{ secrets.PRODUCTION_USERNAME }} | ||
key: ${{ secrets.PRODUCTION_PRIVATE_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
cd QAcc-BE | ||
## Third Deployment | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=1 --scale qacc-be-graph-ql2=1 --scale qacc-be-graph-ql3=0 | ||
docker compose up -d --no-deps --scale qacc-be-job1=1 --scale qacc-be-job2=1 --scale qacc-be-job3=0 | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql3=0 | ||
docker compose up -d --no-deps --scale qacc-be-job3=0 | ||
docker compose up -d | ||
# Wait for qacc-be-graph-ql3 to be healthy (timeout after 5 minutes) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,11 +21,24 @@ jobs: | |
git pull origin staging | ||
docker image prune -a --force | ||
docker compose pull | ||
rollout-deploy-1: | ||
needs: deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: SSH and Redeploy | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.STAGING_HOST }} | ||
username: ${{ secrets.STAGING_USERNAME }} | ||
key: ${{ secrets.STAGING_PRIVATE_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
cd QAcc-BE | ||
## Update each backend service one by one | ||
## First Deployment | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=0 --scale qacc-be-graph-ql2=1 --scale qacc-be-graph-ql3=1 | ||
docker compose up -d --no-deps --scale qacc-be-job1=0 --scale qacc-be-job2=1 --scale qacc-be-job3=1 | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=0 | ||
docker compose up -d --no-deps --scale qacc-be-job1=0 | ||
docker compose up -d | ||
# Wait for qacc-be-graph-ql1 to be healthy (timeout after 5 minutes) | ||
|
@@ -47,9 +60,22 @@ jobs: | |
fi | ||
echo "First deployment phase completed successfully" | ||
rollout-deploy-2: | ||
needs: rollout-deploy-1 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: SSH and Redeploy | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.STAGING_HOST }} | ||
username: ${{ secrets.STAGING_USERNAME }} | ||
key: ${{ secrets.STAGING_PRIVATE_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
cd QAcc-BE | ||
## Second Deployment | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=1 --scale qacc-be-graph-ql2=0 --scale qacc-be-graph-ql3=1 | ||
docker compose up -d --no-deps --scale qacc-be-job1=1 --scale qacc-be-job2=0 --scale qacc-be-job3=1 | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql2=0 | ||
docker compose up -d --no-deps --scale qacc-be-job2=0 | ||
docker compose up -d | ||
# Wait for qacc-be-graph-ql2 to be healthy (timeout after 5 minutes) | ||
|
@@ -71,9 +97,22 @@ jobs: | |
fi | ||
echo "Second deployment phase completed successfully" | ||
rollout-deploy-3: | ||
needs: rollout-deploy-2 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: SSH and Redeploy | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.STAGING_HOST }} | ||
username: ${{ secrets.STAGING_USERNAME }} | ||
key: ${{ secrets.STAGING_PRIVATE_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
cd QAcc-BE | ||
## Third Deployment | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=1 --scale qacc-be-graph-ql2=1 --scale qacc-be-graph-ql3=0 | ||
docker compose up -d --no-deps --scale qacc-be-job1=1 --scale qacc-be-job2=1 --scale qacc-be-job3=0 | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql3=0 | ||
docker compose up -d --no-deps --scale qacc-be-job3=0 | ||
docker compose up -d | ||
# Wait for qacc-be-graph-ql3 to be healthy (timeout after 5 minutes) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,10 +164,23 @@ jobs: | |
docker image prune -a --force | ||
docker compose pull | ||
rollout-deploy-1: | ||
needs: deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: SSH and Redeploy | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.STAGING_HOST }} | ||
username: ${{ secrets.STAGING_USERNAME }} | ||
key: ${{ secrets.STAGING_PRIVATE_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
cd QAcc-BE | ||
## Update each backend service one by one | ||
## First Deployment | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=0 --scale qacc-be-graph-ql2=1 --scale qacc-be-graph-ql3=1 | ||
docker compose up -d --no-deps --scale qacc-be-job1=0 --scale qacc-be-job2=1 --scale qacc-be-job3=1 | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=0 | ||
docker compose up -d --no-deps --scale qacc-be-job1=0 | ||
docker compose up -d | ||
# Wait for qacc-be-graph-ql1 to be healthy (timeout after 5 minutes) | ||
|
@@ -189,9 +202,22 @@ jobs: | |
fi | ||
echo "First deployment phase completed successfully" | ||
rollout-deploy-2: | ||
needs: rollout-deploy-1 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: SSH and Redeploy | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.STAGING_HOST }} | ||
username: ${{ secrets.STAGING_USERNAME }} | ||
key: ${{ secrets.STAGING_PRIVATE_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
cd QAcc-BE | ||
## Second Deployment | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=1 --scale qacc-be-graph-ql2=0 --scale qacc-be-graph-ql3=1 | ||
docker compose up -d --no-deps --scale qacc-be-job1=1 --scale qacc-be-job2=0 --scale qacc-be-job3=1 | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql2=0 | ||
docker compose up -d --no-deps --scale qacc-be-job2=0 | ||
docker compose up -d | ||
# Wait for qacc-be-graph-ql2 to be healthy (timeout after 5 minutes) | ||
|
@@ -213,9 +239,22 @@ jobs: | |
fi | ||
echo "Second deployment phase completed successfully" | ||
rollout-deploy-3: | ||
needs: rollout-deploy-2 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: SSH and Redeploy | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.STAGING_HOST }} | ||
username: ${{ secrets.STAGING_USERNAME }} | ||
key: ${{ secrets.STAGING_PRIVATE_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
cd QAcc-BE | ||
## Third Deployment | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql1=1 --scale qacc-be-graph-ql2=1 --scale qacc-be-graph-ql3=0 | ||
docker compose up -d --no-deps --scale qacc-be-job1=1 --scale qacc-be-job2=1 --scale qacc-be-job3=0 | ||
docker compose up -d --no-deps --scale qacc-be-graph-ql3=0 | ||
docker compose up -d --no-deps --scale qacc-be-job3=0 | ||
docker compose up -d | ||
# Wait for qacc-be-graph-ql3 to be healthy (timeout after 5 minutes) | ||
|