Skip to content

dc/rest-push bump deps #53

dc/rest-push bump deps

dc/rest-push bump deps #53

Workflow file for this run

name: CI/CD dc-rest-push
on:
push:
paths:
- "collectors/rest-push/**"
- ".github/workflows/dc-rest-push.yml"
env:
WORKING_DIRECTORY: collectors/rest-push
DOCKER_IMAGE: ghcr.io/noi-techpark/opendatahub-collectors/dc-rest-push
DOCKER_TAG: ${{ github.sha }}
KUBERNETES_NAMESPACE: collector
jobs:
test:
runs-on: ubuntu-22.04
concurrency: dc-rest-push-test
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Run tests
run: sh run-tests.sh
working-directory: ${{env.WORKING_DIRECTORY}}/test
build:
runs-on: ubuntu-22.04
concurrency: dc-rest-push-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:
if: github.ref == 'refs/heads/main'
needs:
- test
- build
runs-on: ubuntu-22.04
concurrency: dc-rest-push-deploy-test
environment: test
env:
VALUES_YAML: collectors/rest-push/infrastructure/helm/values.yaml
K8S_NAME: dc-rest-push
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_LOGLEVEL: "INFO"
APP_SWAGGERURL: "https://swagger.opendatahub.testingmachine.eu/?url=https://push.api.dev.testingmachine.eu/apispec"
APP_AUTHURL: "https://auth.opendatahub.testingmachine.eu/auth"
APP_AUTHREALM: "noi"
APP_AUTHCLIENTID: "opendatahub-push"
APP_RABBITCLIENTNAME: "dc-rest-push"
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: ${{ env.WORKING_DIRECTORY}}/infrastructure/helm/rest-push
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/prod'
needs:
- test
- build
runs-on: ubuntu-22.04
concurrency: dc-rest-push-deploy-prod
environment: prod
env:
VALUES_YAML: collectors/rest-push/infrastructure/helm/values.yaml
K8S_NAME: dc-rest-push
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_LOGLEVEL: "INFO"
APP_SWAGGERURL: "https://swagger.opendatahub.com/?url=https://push.api.opendatahub.com/apispec"
APP_AUTHURL: "https://auth.opendatahub.com/auth"
APP_AUTHREALM: "noi"
APP_AUTHCLIENTID: "opendatahub-push"
APP_RABBITCLIENTNAME: "dc-rest-push"
ingress:
enabled: true
annotations:
cert-manager.io/issuer: "letsencrypt-prod"
className: nginx
tls:
- hosts:
- push.api.opendatahub.com
secretName: tls-rest-push
hosts:
- host: push.api.opendatahub.com
paths:
- path: "/"
pathType: Prefix
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: ${{ env.WORKING_DIRECTORY}}/infrastructure/helm/rest-push
values-file: ${{ env.VALUES_YAML }}
aws-access-key-id: ${{ secrets.AWS_PROD_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_PROD_ACCESS_KEY_SECRET }}
aws-eks-cluster-name: aws-main-eu-01
aws-region: eu-west-1