Skip to content

Commit

Permalink
echarging-ocpi prepare production deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
clezag committed Nov 19, 2024
1 parent e43c9d1 commit 26eabfd
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 3 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/dc-echarging-ocpi-neogy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,59 @@ jobs:
EOF
# Merge yaml files https://mikefarah.gitbook.io/yq/operators/multiply-merge
yq -i '. *= load("override.yml")' ${{env.VALUES_YAML}}
- name: Deploy on cluster
uses: noi-techpark/github-actions/helm-deploy@v2
with:
k8s-name: ${{ env.K8S_NAME }}
k8s-namespace: collector
chart-path: helm/generic-collector
values-file: ${{ env.VALUES_YAML }}
aws-access-key-id: ${{ secrets.AWS_DEV_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DEV_ACCESS_KEY_SECRET }}
aws-eks-cluster-name: aws-main-eu-01
aws-region: eu-west-1

deploy-prod:
if: github.ref == 'refs/heads/main'
needs:
- build
runs-on: ubuntu-22.04
concurrency: dc-echarging-ocpi-neogy-deploy-prod
environment: prod
env:
VALUES_YAML: collectors/echarging-ocpi/infrastructure/helm/neogy.yaml
K8S_NAME: dc-echarging-ocpi-neogy
steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Write environment-specific Helm values
run: |
cat <<EOF > override.yml
image:
repository: ${{ env.DOCKER_IMAGE }}
tag: ${{ env.DOCKER_TAG }}
pullPolicy: "IfNotPresent"
tls:
- hosts:
- neogy.ocpi.io.opendatahub.com
secretName: tls-ocpi-neogy
hosts:
- host: neogy.ocpi.io.opendatahub.com
paths:
- path: "/"
pathType: Prefix
env:
LOG_LEVEL: "INFO"
envSecret:
OCPI_TOKENS: ${{ secrets.ECHARGING_OCPI_NEOGY_TOKENS }}
PULL_LOCATIONS_ENDPOINT: ${{ secrets.ECHARGING_NEOGY_OCPI_URL}}?limit=200
PULL_TOKEN: "${{ secrets.ECHARGING_NEOGY_OCPI_TOKEN_C }}"
EOF
# Merge yaml files https://mikefarah.gitbook.io/yq/operators/multiply-merge
yq -i '. *= load("override.yml")' ${{env.VALUES_YAML}}
Expand Down
9 changes: 6 additions & 3 deletions collectors/echarging-ocpi/infrastructure/helm/neogy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,29 @@ ingress:
tls:
- hosts:
- ocpi-neogy.ex.dev.testingmachine.eu
secretName: tls-ocpi-neogy-old
- hosts:
- neogy.ocpi.io.dev.testingmachine.eu
secretName: tls-ocpi-neogy
hosts:
# Remove this as soon we get into production, and move to the <provider>.ocpi type subdomain
- host: ocpi-neogy.ex.dev.testingmachine.eu
paths:
- path: "/"
pathType: Prefix
- host: neogy.ocpi.ex.dev.testingmachine.eu
- host: neogy.ocpi.io.dev.testingmachine.eu
paths:
- path: "/"
pathType: Prefix

env:
PORT: 8080
GIN_MODE: release
LOG_LEVEL: DEBUG
MQ_CLIENT: dc-echarging-ocpi-driwe
MQ_EXCHANGE: ingress
PORT: 8080
PROVIDER: echarging-ocpi/neogy
PULL_LOCATIONS_CRON: "0 0,4,8,12,16 * * *"
MQ_CLIENT: dc-echarging-ocpi-driwe

envSecret:
# List of valid tokens, no spaces etc.
Expand Down

0 comments on commit 26eabfd

Please sign in to comment.