From ef8b2b673b3e2e725bd93d38662afcdc0756646b Mon Sep 17 00:00:00 2001 From: Vitor Hideyoshi Nakazone Batista Date: Wed, 14 Feb 2024 02:48:34 -0300 Subject: [PATCH 1/3] Fixes CI/CD Timeout --- .github/workflows/deploy-prod.yml | 1 + .github/workflows/deploy-staging.yml | 91 ++++++++++++++-------------- 2 files changed, 47 insertions(+), 45 deletions(-) diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index ed5be97..185e573 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -48,6 +48,7 @@ jobs: username: ${{ secrets.SSH_USER }} port: ${{ secrets.SSH_PORT }} key: ${{ secrets.SSH_KEY }} + command_timeout: 1800s script: | sudo apt update && sudo apt install -y jq source ~/.profile diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index e02142c..87a274e 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -1,54 +1,55 @@ name: remote ssh command on: - push: - branches: - - staging + push: + branches: + - staging jobs: - build: - name: Build - environment: staging - runs-on: ubuntu-latest - timeout-minutes: 30 - - steps: - - uses: actions/checkout@v4 - - name: Set up Python 3.8 - uses: actions/setup-python@v3 - with: - python-version: "3.10" + build: + name: Build + environment: staging + runs-on: ubuntu-latest + timeout-minutes: 30 - - name: Create Config Json File - run: | - echo "${{ secrets.CONFIG_JSON }}" | base64 -d > config.json + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.8 + uses: actions/setup-python@v3 + with: + python-version: "3.10" - - name: Inserts Prod Enviromental Variables - run: | - python -m pip install --upgrade pip pipenv - pipenv install - pipenv run python setup.py -e staging -f config.json + - name: Create Config Json File + run: | + echo "${{ secrets.CONFIG_JSON }}" | base64 -d > config.json - - name: copy file via ssh - uses: appleboy/scp-action@master - with: - host: ${{ secrets.SSH_HOST }} - username: ${{ secrets.SSH_USER }} - port: ${{ secrets.SSH_PORT }} - key: ${{ secrets.SSH_KEY }} - source: "." - target: "infra-hideyoshi.com" + - name: Inserts Prod Enviromental Variables + run: | + python -m pip install --upgrade pip pipenv + pipenv install + pipenv run python setup.py -e staging -f config.json - - name: executing remote ssh commands - uses: appleboy/ssh-action@master - with: - host: ${{ secrets.SSH_HOST }} - username: ${{ secrets.SSH_USER }} - port: ${{ secrets.SSH_PORT }} - key: ${{ secrets.SSH_KEY }} - script: | - sudo apt update && sudo apt install -y jq - source ~/.profile - cd infra-hideyoshi.com - ./deploy.sh --staging - ./refresh.sh \ No newline at end of file + - name: copy file via ssh + uses: appleboy/scp-action@master + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USER }} + port: ${{ secrets.SSH_PORT }} + key: ${{ secrets.SSH_KEY }} + source: "." + target: "infra-hideyoshi.com" + + - name: executing remote ssh commands + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USER }} + port: ${{ secrets.SSH_PORT }} + key: ${{ secrets.SSH_KEY }} + command_timeout: 1800s + script: | + sudo apt update && sudo apt install -y jq + source ~/.profile + cd infra-hideyoshi.com + ./deploy.sh --staging + ./refresh.sh From ec1b6a98cac5ed70fe3c3336f6b24210efc659ba Mon Sep 17 00:00:00 2001 From: Vitor Hideyoshi Nakazone Batista Date: Wed, 14 Feb 2024 23:25:45 -0300 Subject: [PATCH 2/3] Fixes SSH Command Timeout --- .github/workflows/deploy-prod.yml | 2 +- .github/workflows/deploy-staging.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index 185e573..31a0abe 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -48,7 +48,7 @@ jobs: username: ${{ secrets.SSH_USER }} port: ${{ secrets.SSH_PORT }} key: ${{ secrets.SSH_KEY }} - command_timeout: 1800s + command_timeout: 30m script: | sudo apt update && sudo apt install -y jq source ~/.profile diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 87a274e..73ef29f 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -46,7 +46,7 @@ jobs: username: ${{ secrets.SSH_USER }} port: ${{ secrets.SSH_PORT }} key: ${{ secrets.SSH_KEY }} - command_timeout: 1800s + command_timeout: 30m script: | sudo apt update && sudo apt install -y jq source ~/.profile From b0d81f86b6a2386617fa475aaa90effea79a889d Mon Sep 17 00:00:00 2001 From: Vitor Hideyoshi Nakazone Batista Date: Fri, 16 Feb 2024 01:37:52 -0300 Subject: [PATCH 3/3] Fixes Per Deployment Refresh --- .github/workflows/refresh-deployment.yml | 2 +- deploy.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/refresh-deployment.yml b/.github/workflows/refresh-deployment.yml index bf36fed..36adfc7 100644 --- a/.github/workflows/refresh-deployment.yml +++ b/.github/workflows/refresh-deployment.yml @@ -41,4 +41,4 @@ jobs: script: | [[ -d infra-hideyoshi.com ]] && \ cd infra-hideyoshi.com && \ - ./infra-hideyoshi.com/refresh.sh ${{ env.deployments }} \ No newline at end of file + ./refresh.sh ${{ env.deployments }} \ No newline at end of file diff --git a/deploy.sh b/deploy.sh index dc691d5..ebae0d7 100755 --- a/deploy.sh +++ b/deploy.sh @@ -111,7 +111,7 @@ function main() { minikube kubectl -- $@ } - minikube start --driver kvm2 --cpus 4 --memory 4Gib + minikube start --driver kvm2 --cpus 6 --memory 6Gib minikube addons enable ingress-dns minikube addons enable ingress