Skip to content

Commit

Permalink
Add jobConfig.json file
Browse files Browse the repository at this point in the history
This isn't read by the current version, but let's check if it gets
written from the secret correctly.

Also uncomment the be workflow
  • Loading branch information
sbliven committed Jun 28, 2024
1 parent 5f92023 commit c17621e
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 69 deletions.
130 changes: 65 additions & 65 deletions .github/workflows/scicat-be.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
# name: scicat-be
name: scicat-be

# on:
# workflow_dispatch:
# inputs:
# submodule_commit:
# description: 'Commit of the submodule to deploy'
# required: false
# commit:
# description: 'Commit of the CI repo to deploy'
# required: false
# pull_request:
# branches: [ main ]
# push:
# branches: [ main ]
# release:
# types: [published]
on:
workflow_dispatch:
inputs:
submodule_commit:
description: 'Commit of the submodule to deploy'
required: false
commit:
description: 'Commit of the CI repo to deploy'
required: false
pull_request:
branches: [ main ]
push:
branches: [ main ]
release:
types: [published]

# jobs:
jobs:

# set_env:
# uses: ./.github/workflows/reusable.environment.yml
# with:
# commit: ${{ github.event.inputs.commit }}
# submodule_commit: ${{ github.event.inputs.submodule_commit }}
set_env:
uses: ./.github/workflows/reusable.environment.yml
with:
commit: ${{ github.event.inputs.commit }}
submodule_commit: ${{ github.event.inputs.submodule_commit }}

# check_changed:
# needs: set_env
# uses: ./.github/workflows/reusable.changes.yml
# with:
# files: |
# .github/workflows/scicat-be.yml
# helm/configs/backend/values.yaml
# helm/configs/backend/login-callbacks.js
# helm/configs/backend/config.local.js
# helm/configs/backend/job-template.html
# helm/configs/backend/${{ needs.set_env.outputs.environment }}/**
# backend/**
# helm/configs/backend/authorizedJobs.js
# commit: ${{ needs.set_env.outputs.commit }}
# submodule_commit: ${{ github.event.inputs.submodule_commit }}
# submodule: backend
check_changed:
needs: set_env
uses: ./.github/workflows/reusable.changes.yml
with:
files: |
.github/workflows/scicat-be.yml
helm/configs/backend/values.yaml
helm/configs/backend/login-callbacks.js
helm/configs/backend/config.local.js
helm/configs/backend/job-template.html
helm/configs/backend/${{ needs.set_env.outputs.environment }}/**
backend/**
helm/configs/backend/authorizedJobs.js
commit: ${{ needs.set_env.outputs.commit }}
submodule_commit: ${{ github.event.inputs.submodule_commit }}
submodule: backend

# build_deploy_scicat_be:
# if: (needs.check_changed.outputs.changed == 'true' && !needs.set_env.outputs.component) || needs.set_env.outputs.component == 'be'
# needs:
# - check_changed
# - set_env
# uses: ./.github/workflows/reusable.build-deploy.yml
# with:
# context: backend/.
# image_name: ${{ github.repository }}/be
# release_name: backend
# tag: ${{ needs.set_env.outputs.tag }}
# environment: ${{ needs.set_env.outputs.environment }}
# commit: ${{ needs.set_env.outputs.commit }}
# submodule_commit: ${{ github.event.inputs.submodule_commit }}
# submodule: backend
# helm_set_files: >-
# CONFIG_LOCAL=helm/configs/backend/config.local.js
# LOGIN_CALLBACKS=helm/configs/backend/login-callbacks.js
# MIDDLEWARE=helm/configs/backend/${{ needs.set_env.outputs.environment }}/middleware.json
# EMAIL_TEMPLATE=helm/configs/backend/job-template.html
# HIDE_EMAIL=helm/configs/backend/hideEmail.js
# AUTHORIZED_JOBS=helm/configs/backend/authorizedJobs.js
# secrets:
# KUBECONFIG: ${{ secrets.KUBECONFIG }}
# JSON_SECRETS: ${{ toJSON(secrets) }}
# BASTION_USER: ${{ secrets.BASTION_USER }}
# BASTION_SSH_KEY: ${{ secrets.BASTION_SSH_KEY }}
build_deploy_scicat_be:
if: (needs.check_changed.outputs.changed == 'true' && !needs.set_env.outputs.component) || needs.set_env.outputs.component == 'be'
needs:
- check_changed
- set_env
uses: ./.github/workflows/reusable.build-deploy.yml
with:
context: backend/.
image_name: ${{ github.repository }}/be
release_name: backend
tag: ${{ needs.set_env.outputs.tag }}
environment: ${{ needs.set_env.outputs.environment }}
commit: ${{ needs.set_env.outputs.commit }}
submodule_commit: ${{ github.event.inputs.submodule_commit }}
submodule: backend
helm_set_files: >-
CONFIG_LOCAL=helm/configs/backend/config.local.js
LOGIN_CALLBACKS=helm/configs/backend/login-callbacks.js
MIDDLEWARE=helm/configs/backend/${{ needs.set_env.outputs.environment }}/middleware.json
EMAIL_TEMPLATE=helm/configs/backend/job-template.html
HIDE_EMAIL=helm/configs/backend/hideEmail.js
AUTHORIZED_JOBS=helm/configs/backend/authorizedJobs.js
secrets:
KUBECONFIG: ${{ secrets.KUBECONFIG }}
JSON_SECRETS: ${{ toJSON(secrets) }}
BASTION_USER: ${{ secrets.BASTION_USER }}
BASTION_SSH_KEY: ${{ secrets.BASTION_SSH_KEY }}
14 changes: 10 additions & 4 deletions helm/configs/backend-next/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,23 @@ volumes:
secret:
secretName: "{{ .Release.Name }}-s"

secrets:
secrets:
"{{ .Release.Name }}-s":
type: Opaque
data:
data:
.env: "{{ .Values.secretsJson.BENEXT_ENV }}"
functionalAccounts.json: "{{ .Values.secretsJson.BENEXT_FUNCTIONAL_ACCOUNTS }}"
jobConfig.json: "{{ .Values.secretsJson.BENEXT_JOBCONFIG }}"

ingress:
enabled: true
annotations:
annotations:
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: letsencrypt-prod
nginx.ingress.kubernetes.io/proxy-body-size: 50m
hosts:
- host: "{{ .Values.host }}"
paths:
paths:
- path: "/"
pathType: Prefix
tls:
Expand All @@ -46,6 +47,8 @@ env:
value: "20.500.11935"
- name: SITE
value: "PSI"
- name: JOB_CONFIGURATION_FILE
value: /home/node/app/jobConfig.json

volumeMounts:
- name: secrets-volume
Expand All @@ -54,3 +57,6 @@ volumeMounts:
- name: secrets-volume
mountPath: /home/node/app/functionalAccounts.json
subPath: functionalAccounts.json
- name: secrets-volume
mountPath: /home/node/app/jobConfig.json
subPath: jobConfig.json

0 comments on commit c17621e

Please sign in to comment.