Skip to content

dc-mqtt rename env a22, add new CICD config parking onstreet bz #1

dc-mqtt rename env a22, add new CICD config parking onstreet bz

dc-mqtt rename env a22, add new CICD config parking onstreet bz #1

name: CI/CD dc-mqtt-client environment a22
on:
push:
paths:
- "collectors/mqtt-client/**"
- ".github/workflows/dc-mqtt-client-environment-a22.yml"
env:
WORKING_DIRECTORY: collectors/mqtt-client
DOCKER_IMAGE: ghcr.io/noi-techpark/opendatahub-collectors/dc-mqtt-client
DOCKER_TAG: ${{ github.sha }}
KUBERNETES_NAMESPACE: collector
jobs:
build:
runs-on: ubuntu-22.04
concurrency: dc-mqtt-client-build
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Build and push images
uses: noi-techpark/github-actions/docker-build-and-push@v2
with:
working-directory: ${{ env.WORKING_DIRECTORY }}/infrastructure
docker-username: ${{ github.actor }}
docker-password: ${{ secrets.GITHUB_TOKEN }}
deploy-test-env-a22:
if: github.ref == 'refs/heads/main'
needs:
- build
runs-on: ubuntu-22.04
concurrency: dc-mqtt-client-env-a22-deploy-test
environment: test
env:
VALUES_YAML: collectors/mqtt-client/infrastructure/helm/env-a22.yaml
K8S_NAME: dc-mqtt-client-env-a22
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"
env:
APP_MQTT_CLIENTID: airQuinoRawTestv2
APP_MQTT_TOPIC: AirQuino/RawData
APP_LOGLEVEL: INFO
APP_PROVIDER: a22/environment
envSecret:
APP_MQTT_PASS: ${{ secrets.MQTT_ENV_A22_PASS}}
APP_MQTT_URI: ${{ secrets.MQTT_ENV_A22_URI}}
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