Skip to content

Commit

Permalink
Bananobot migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
bbedward committed Jun 28, 2024
1 parent d11a4f9 commit 41a1102
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 52 deletions.
68 changes: 34 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,37 +165,37 @@ jobs:
with:
args: apply -f ./kubernetes/graham_banano/deployment-k.yaml

# deploy_bananobot:
# name: Deploy BananoBot++
# needs: build_and_publish
# runs-on: ubuntu-latest
# env:
# GITHUB_RUN_ID: ${{ github.run_id }}
# steps:
# - uses: actions/checkout@master
# - uses: imranismail/setup-kustomize@v1
# with:
# kustomize-version: "3.x"

# - name: Get branch name (merge)
# if: github.event_name != 'pull_request'
# shell: bash
# run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV

# - name: Get branch name (pull request)
# if: github.event_name == 'pull_request'
# shell: bash
# run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV

# - name: Set image
# working-directory: ./kubernetes/bananobot
# run: |
# kustomize edit set image replaceme=bananocoin/graham:${{ env.BRANCH_NAME }}-${{ env.GITHUB_RUN_ID }}
# kustomize build . > deployment-k.yaml

# - name: Deploy image to k8s cluster
# uses: bbedward/kubectl@master
# env:
# KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
# with:
# args: apply -f ./kubernetes/bananobot/deployment-k.yaml
deploy_bananobot:
name: Deploy BananoBot++
needs: build_and_publish
runs-on: ubuntu-latest
env:
GITHUB_RUN_ID: ${{ github.run_id }}
steps:
- uses: actions/checkout@master
- uses: imranismail/setup-kustomize@v1
with:
kustomize-version: '3.x'

- name: Get branch name (merge)
if: github.event_name != 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV

- name: Get branch name (pull request)
if: github.event_name == 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV

- name: Set image
working-directory: ./kubernetes/bananobot
run: |
kustomize edit set image replaceme=bananocoin/graham:${{ env.BRANCH_NAME }}-${{ env.GITHUB_RUN_ID }}
kustomize build . > deployment-k.yaml
- name: Deploy image to k8s cluster
uses: bbedward/kubectl@master
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
with:
args: apply -f ./kubernetes/bananobot/deployment-k.yaml
12 changes: 3 additions & 9 deletions kubernetes/bananobot/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,11 @@ spec:
- name: REDIS_DB
value: "8"
- name: POSTGRES_HOST
value: postgres.kubegres
value: pg-bananobot.graham-banano
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: bananobot
key: postgres_db
value: postgres
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: bananobot
key: postgres_user
value: postgres
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
Expand Down
12 changes: 3 additions & 9 deletions kubernetes/bananobot/deployment_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,11 @@ spec:
- name: REDIS_DB
value: "8"
- name: POSTGRES_HOST
value: postgres.kubegres
value: pg-bananobot.graham-banano
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: bananobot
key: postgres_db
value: postgres
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: bananobot
key: postgres_user
value: postgres
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
Expand Down

0 comments on commit 41a1102

Please sign in to comment.