Skip to content

Commit

Permalink
cicd for rest poller
Browse files Browse the repository at this point in the history
  • Loading branch information
clezag committed Apr 9, 2024
1 parent 68f0a75 commit 09d4c7d
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 4 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/dc-rest-poller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI/CD dc-rest-poller-route220

on:
push:
paths:
- "collectors/rest-poller/**"
- ".github/workflows/dc-rest-poller"

env:
WORKING_DIRECTORY: collectors/rest-poller
DOCKER_IMAGE: ghcr.io/noi-techpark/opendatahub-collectors/dc-rest-poller
DOCKER_TAG: ${{ github.sha }}
KUBERNETES_NAMESPACE: collector
JAVA_VERSION: 17

jobs:
build:
runs-on: ubuntu-22.04
concurrency: dc-rest-poller-build
steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Build libs
uses: noi-techpark/github-actions/maven-build@v2
with:
working-directory: collectors/lib/ingress-mq
java-version: ${{ env.JAVA_VERSION }}
build-command: 'mvn clean install'

- name: Build project
uses: noi-techpark/github-actions/maven-build@v2
with:
working-directory: ${{ env.WORKING_DIRECTORY }}
java-version: ${{ env.JAVA_VERSION }}
build-command: 'mvn clean install'

- 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-route220-test:
if: github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-22.04
concurrency: dc-rest-poller-route220-test
environment: test
env:
VALUES_YAML: ${{ env.WORKING_DIRECTORY }}/infrastructure/helm/echarging-route220.yaml
K8S_NAME: dc-rest-poller-echarging-route220
steps:
- name: Customize values.yaml
run: |
yq -i '.image.repository="${{ env.DOCKER_IMAGE }}"' ${{ env.VALUES_YAML}}
yq -i '.image.tag="${{ env.DOCKER_TAG }}"' ${{ env.VALUES_YAML }}
yq -i '.image.pullPolicy=IfNotPresent' ${{ 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: ${{ env.AWS_DEV_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_DEV_ACCESS_KEY_SECRET }}
aws-eks-cluster-name: aws-main-eu-01
aws-region: eu-west-1
2 changes: 1 addition & 1 deletion collectors/rest-poller/infrastructure/helm/alperia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ nameOverride: dc-echarging-alperia
fullnameOverride: dc-echarging-alperia
image:
repository: ghcr.io/noi-techpark/opendatahub-collectors/rest-poller
pullPolicy: Always
pullPolicy: IfNotPresent
tag: "0.2.0" # Set this when upgrading chart with --set-value

imagePullSecrets:
Expand Down
2 changes: 1 addition & 1 deletion collectors/rest-poller/infrastructure/helm/driwe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ nameOverride: dc-echarging-driwe
fullnameOverride: dc-echarging-driwe
image:
repository: ghcr.io/noi-techpark/opendatahub-collectors/rest-poller
pullPolicy: Always
pullPolicy: IfNotPresent
tag: "0.2.0" # Set this when upgrading chart with --set-value

imagePullSecrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ nameOverride: dc-echarging-route220
fullnameOverride: dc-echarging-route220
image:
repository: ghcr.io/noi-techpark/opendatahub-collectors/rest-poller
pullPolicy: Always
pullPolicy: IfNotPresent
tag: "0.2.0" # Set this when upgrading chart with --set-value

imagePullSecrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ nameOverride: dc-parking-offstreet-merano
fullnameOverride: dc-parking-offstreet-merano
image:
repository: ghcr.io/noi-techpark/opendatahub-collectors/rest-poller
pullPolicy: Always
pullPolicy: IfNotPresent
tag: "0.2.0" # Set this when upgrading chart with --set-value

imagePullSecrets:
Expand Down

0 comments on commit 09d4c7d

Please sign in to comment.