Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 26 additions & 18 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ on:
- 'deploy/**'
- '.github/workflows/**'
workflow_dispatch:

# ✅ Global permissions so coverage and PR checks can post results when allowed
permissions:
contents: read
pull-requests: write
checks: write

jobs:
build-context:
runs-on: ubuntu-latest
Expand All @@ -16,6 +23,7 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"

build:
needs: build-context
runs-on: ubuntu-latest
Expand Down Expand Up @@ -68,14 +76,16 @@ jobs:
echo "TAG_NAME=${{ steps.branch-name.outputs.base_ref_branch }}" >> ${GITHUB_ENV}
echo "TAG_LATEST=${{ steps.branch-name.outputs.base_ref_branch }}" >> ${GITHUB_ENV}

# setup Docker build action
# Docker setup
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3

# Build all service images
- name: Build crapi-identity image
uses: docker/build-push-action@v3
with:
Expand All @@ -101,13 +111,13 @@ jobs:
- name: Build crapi-chatbot image
uses: docker/build-push-action@v3
with:
context: ./services/chatbot
tags: crapi/crapi-chatbot:${{ env.TAG_LATEST }},crapi/crapi-chatbot:${{ env.TAG_NAME }}
push: false
load: true
platforms: linux/amd64
cache-from: type=gha,scope==chatbot-service
cache-to: type=gha,mode=max,scope=chatbot-service
context: ./services/chatbot
tags: crapi/crapi-chatbot:${{ env.TAG_LATEST }},crapi/crapi-chatbot:${{ env.TAG_NAME }}
push: false
load: true
platforms: linux/amd64
cache-from: type=gha,scope=chatbot-service
cache-to: type=gha,mode=max,scope=chatbot-service

- name: Build crapi-community image
uses: docker/build-push-action@v3
Expand Down Expand Up @@ -162,12 +172,12 @@ jobs:
- name: Cleanup docker before running
if: always()
continue-on-error: true
run: docker compose -f deploy/docker/docker-compose.yml down --volumes --remove-orphans
run: docker compose -f deploy/docker/docker-compose.yml down --volumes --remove-orphans

- name: Run crAPI using built images
run: |
cd deploy/docker
VERSION=${{ env.TAG_NAME }} docker compose -f docker-compose.yml --compatibility up -d
cd deploy/docker
VERSION=${{ env.TAG_NAME }} docker compose -f docker-compose.yml --compatibility up -d

- name: Install Node
uses: actions/setup-node@v3
Expand All @@ -186,7 +196,7 @@ jobs:

- name: Cleanup docker
if: always()
run: docker compose -f deploy/docker/docker-compose.yml down --volumes --remove-orphans
run: docker compose -f deploy/docker/docker-compose.yml down --volumes --remove-orphans


tests:
Expand Down Expand Up @@ -234,13 +244,9 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v8.0.0
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v2.2.1
working-directory: services/community


- name: Install system dependencies for workshop
run: |
sudo apt-get update
Expand Down Expand Up @@ -275,11 +281,13 @@ jobs:
coverage report
coverage xml -o coverage.xml

# ✅ Skip coverage comment on forks to avoid HttpError
- name: Publish Coverage for workshop
if: github.event.pull_request.head.repo.full_name == github.repository
uses: orgoro/coverage@v3.2
with:
coverageFile: services/workshop/coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
coverageFile: services/workshop/coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}

- name: node prettier
run: |
Expand Down
44 changes: 22 additions & 22 deletions deploy/helm/templates/chatbot/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ metadata:
release: {{ .Release.Name }}
{{- toYaml .Values.chatbot.config.labels | nindent 4 }}
data:
SERVER_PORT: {{ .Values.chatbot.port | quote }}
IDENTITY_SERVICE: {{ .Values.identity.service.name }}:{{ .Values.identity.port }}
WEB_SERVICE: {{ .Values.web.service.name }}
TLS_ENABLED: {{ .Values.tlsEnabled | quote }}
DB_HOST: {{ .Values.postgresdb.service.name }}
DB_USER: {{ .Values.postgresdb.config.postgresUser }}
DB_PASSWORD: {{ .Values.postgresdb.config.postgresPassword }}
DB_NAME: {{ .Values.postgresdb.config.postgresDbName }}
DB_PORT: {{ .Values.postgresdb.port | quote }}
MONGO_DB_HOST: {{ .Values.mongodb.service.name }}
MONGO_DB_PORT: {{ .Values.mongodb.port | quote }}
MONGO_DB_USER: {{ .Values.mongodb.config.mongoUser }}
MONGO_DB_PASSWORD: {{ .Values.mongodb.config.mongoPassword }}
MONGO_DB_NAME: {{ .Values.mongodb.config.mongoDbName }}
CHATBOT_OPENAI_API_KEY: {{ .Values.openAIApiKey }}
DEFAULT_MODEL: {{ .Values.chatbot.config.defaultModel | quote }}
MAX_CONTENT_LENGTH: {{ .Values.chatbot.config.maxContentLength | quote }}
CHROMA_HOST: {{ .Values.chromadb.service.name }}
CHROMA_PORT: {{ .Values.chromadb.port | quote }}
API_USER: {{ .Values.chatbot.config.apiUser | quote }}
API_PASSWORD: {{ .Values.chatbot.config.apiPassword | quote }}
OPENAPI_SPEC: {{ .Values.chatbot.config.openapiSpec | quote }}
SERVER_PORT: {{ .Values.chatbot.port | quote }}
IDENTITY_SERVICE: {{ printf "%s:%s" .Values.identity.service.name .Values.identity.port | quote }}
WEB_SERVICE: {{ .Values.web.service.name | quote }}
TLS_ENABLED: {{ .Values.tlsEnabled | quote }}
DB_HOST: {{ .Values.postgresdb.service.name | quote }}
DB_USER: {{ .Values.postgresdb.config.postgresUser | quote }}
DB_PASSWORD: {{ .Values.postgresdb.config.postgresPassword | quote }}
DB_NAME: {{ .Values.postgresdb.config.postgresDbName | quote }}
DB_PORT: {{ .Values.postgresdb.port | quote }}
MONGO_DB_HOST: {{ .Values.mongodb.service.name | quote }}
MONGO_DB_PORT: {{ .Values.mongodb.port | quote }}
MONGO_DB_USER: {{ .Values.mongodb.config.mongoUser | quote }}
MONGO_DB_PASSWORD: {{ .Values.mongodb.config.mongoPassword | quote }}
MONGO_DB_NAME: {{ .Values.mongodb.config.mongoDbName | quote }}
CHATBOT_OPENAI_API_KEY: {{ .Values.openAIApiKey | quote }}
DEFAULT_MODEL: {{ .Values.chatbot.config.defaultModel | quote }}
MAX_CONTENT_LENGTH: {{ .Values.chatbot.config.maxContentLength | quote }}
CHROMA_HOST: {{ .Values.chromadb.service.name | quote }}
CHROMA_PORT: {{ .Values.chromadb.port | quote }}
API_USER: {{ .Values.chatbot.config.apiUser | quote }}
API_PASSWORD: {{ .Values.chatbot.config.apiPassword | quote }}
OPENAPI_SPEC: {{ .Values.chatbot.config.openapiSpec | quote }}
28 changes: 14 additions & 14 deletions deploy/helm/templates/community/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
data:
LOG_LEVEL: {{ .Values.logLevel | upper }}
IDENTITY_SERVICE: {{ .Values.identity.service.name }}:{{ .Values.identity.port }}
DB_HOST: {{ .Values.postgresdb.service.name }}
DB_USER: {{ .Values.postgresdb.config.postgresUser }}
DB_PASSWORD: {{ .Values.postgresdb.config.postgresPassword }}
DB_NAME: {{ .Values.postgresdb.config.postgresDbName }}
DB_PORT: {{ .Values.postgresdb.port | quote }}
MONGO_DB_HOST: {{ .Values.mongodb.service.name }}
MONGO_DB_PORT: {{ .Values.mongodb.port | quote }}
MONGO_DB_USER: {{ .Values.mongodb.config.mongoUser }}
MONGO_DB_PASSWORD: {{ .Values.mongodb.config.mongoPassword }}
MONGO_DB_NAME: {{ .Values.mongodb.config.mongoDbName }}
SERVER_PORT: {{ .Values.community.port | quote }}
TLS_ENABLED: {{ .Values.tlsEnabled | quote }}
LOG_LEVEL: {{ .Values.logLevel | upper | quote }}
IDENTITY_SERVICE: {{ printf "%s:%s" .Values.identity.service.name .Values.identity.port | quote }}
DB_HOST: {{ .Values.postgresdb.service.name | quote }}
DB_USER: {{ .Values.postgresdb.config.postgresUser | quote }}
DB_PASSWORD: {{ .Values.postgresdb.config.postgresPassword | quote }}
DB_NAME: {{ .Values.postgresdb.config.postgresDbName | quote }}
DB_PORT: {{ .Values.postgresdb.port | quote }}
MONGO_DB_HOST: {{ .Values.mongodb.service.name | quote }}
MONGO_DB_PORT: {{ .Values.mongodb.port | quote }}
MONGO_DB_USER: {{ .Values.mongodb.config.mongoUser | quote }}
MONGO_DB_PASSWORD: {{ .Values.mongodb.config.mongoPassword | quote }}
MONGO_DB_NAME: {{ .Values.mongodb.config.mongoDbName | quote }}
SERVER_PORT: {{ .Values.community.port | quote }}
TLS_ENABLED: {{ .Values.tlsEnabled | quote }}
38 changes: 19 additions & 19 deletions deploy/helm/templates/identity/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
data:
LOG_LEVEL: {{ .Values.logLevel | upper }}
JWT_SECRET: {{ .Values.jwtSecret }} #Used for creating a JWT. Can be anything
APP_NAME: {{ .Values.identity.config.appName }}
LOG_LEVEL: {{ .Values.logLevel | upper | quote }}
JWT_SECRET: {{ .Values.jwtSecret | quote }} # Used for creating a JWT. Can be anything
APP_NAME: {{ .Values.identity.config.appName | quote }}
ENABLE_SHELL_INJECTION: {{ .Values.enableShellInjection | quote }}
ENABLE_LOG4J: {{ .Values.enableLog4j | quote }}
DB_HOST: {{ .Values.postgresdb.service.name }}
DB_USER: {{ .Values.postgresdb.config.postgresUser }}
DB_PASSWORD: {{ .Values.postgresdb.config.postgresPassword }}
DB_NAME: {{ .Values.postgresdb.config.postgresDbName }}
DB_HOST: {{ .Values.postgresdb.service.name | quote }}
DB_USER: {{ .Values.postgresdb.config.postgresUser | quote }}
DB_PASSWORD: {{ .Values.postgresdb.config.postgresPassword | quote }}
DB_NAME: {{ .Values.postgresdb.config.postgresDbName | quote }}
DB_PORT: {{ .Values.postgresdb.port | quote }}
MAILHOG_HOST: {{ .Values.mailhog.smtpService.name }}
MAILHOG_HOST: {{ .Values.mailhog.smtpService.name | quote }}
MAILHOG_PORT: {{ .Values.mailhog.smtpPort | quote }}
MAILHOG_DOMAIN: {{ .Values.identity.config.mailhogDomain }}
SMTP_HOST: {{ .Values.identity.config.smtpHost}}
MAILHOG_DOMAIN: {{ .Values.identity.config.mailhogDomain | quote }}
SMTP_HOST: {{ .Values.identity.config.smtpHost | quote }}
SMTP_PORT: {{ .Values.identity.config.smtpPort | quote }}
SMTP_EMAIL: {{ .Values.identity.config.smtpEmail }}
SMTP_PASS: {{ .Values.identity.config.smtpPass }}
SMTP_FROM: {{ .Values.identity.config.smtpFrom }}
SMTP_EMAIL: {{ .Values.identity.config.smtpEmail | quote }}
SMTP_PASS: {{ .Values.identity.config.smtpPass | quote }}
SMTP_FROM: {{ .Values.identity.config.smtpFrom | quote }}
SMTP_AUTH: {{ .Values.identity.config.smtpAuth | quote }}
JWT_EXPIRATION: {{ .Values.jwtExpiration | quote }}
SMTP_STARTTLS: {{ .Values.identity.config.smtpStartTLS | quote }}
SERVER_PORT: {{ .Values.identity.port | quote }}
API_GATEWAY_URL: {{ if .Values.apiGatewayServiceInstall }}"https://{{ .Values.apiGatewayService.service.name }}"{{ else }}{{ .Values.apiGatewayServiceUrl }}{{ end }}
API_GATEWAY_URL: {{ if .Values.apiGatewayServiceInstall }}"https://{{ .Values.apiGatewayService.service.name }}"{{ else }}{{ .Values.apiGatewayServiceUrl | quote }}{{ end }}
TLS_ENABLED: {{ .Values.tlsEnabled | quote }}
TLS_KEYSTORE_TYPE: {{ .Values.identity.config.keyStoreType }}
TLS_KEYSTORE: {{ .Values.identity.config.keyStore }}
TLS_KEYSTORE_PASSWORD: {{ .Values.identity.config.keyStorePassword }}
TLS_KEY_PASSWORD: {{ .Values.identity.config.keyPassword }}
TLS_KEY_ALIAS: {{ .Values.identity.config.keyAlias }}
TLS_KEYSTORE_TYPE: {{ .Values.identity.config.keyStoreType | quote }}
TLS_KEYSTORE: {{ .Values.identity.config.keyStore | quote }}
TLS_KEYSTORE_PASSWORD: {{ .Values.identity.config.keyStorePassword | quote }}
TLS_KEY_PASSWORD: {{ .Values.identity.config.keyPassword | quote }}
TLS_KEY_ALIAS: {{ .Values.identity.config.keyAlias | quote }}
4 changes: 2 additions & 2 deletions deploy/helm/templates/mailhog/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ metadata:
release: {{ .Release.Name }}
{{- toYaml .Values.mailhog.config.labels | nindent 4 }}
data:
MH_MONGO_URI: {{ .Values.mongodb.config.mongoUri }}
MH_STORAGE: {{ .Values.mailhog.config.mailhogStorage }}
MH_MONGO_URI: {{ .Values.mongodb.config.mongoUri | quote }}
MH_STORAGE: {{ .Values.mailhog.config.mailhogStorage | quote }}
10 changes: 5 additions & 5 deletions deploy/helm/templates/web/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ metadata:
release: {{ .Release.Name }}
{{- toYaml .Values.web.config.labels | nindent 4 }}
data:
COMMUNITY_SERVICE: {{ .Values.community.service.name }}:{{ .Values.community.port }}
IDENTITY_SERVICE: {{ .Values.identity.service.name }}:{{ .Values.identity.port }}
WORKSHOP_SERVICE: {{ .Values.workshop.service.name }}:{{ .Values.workshop.port }}
CHATBOT_SERVICE: {{ .Values.chatbot.service.name }}:{{ .Values.chatbot.port }}
MAILHOG_WEB_SERVICE: {{ .Values.mailhog.webService.name }}:{{ .Values.mailhog.webPort }}
COMMUNITY_SERVICE: {{ printf "%s:%s" .Values.community.service.name .Values.community.port | quote }}
IDENTITY_SERVICE: {{ printf "%s:%s" .Values.identity.service.name .Values.identity.port | quote }}
WORKSHOP_SERVICE: {{ printf "%s:%s" .Values.workshop.service.name .Values.workshop.port | quote }}
CHATBOT_SERVICE: {{ printf "%s:%s" .Values.chatbot.service.name .Values.chatbot.port | quote }}
MAILHOG_WEB_SERVICE: {{ printf "%s:%s" .Values.mailhog.webService.name .Values.mailhog.webPort | quote }}
TLS_ENABLED: {{ .Values.tlsEnabled | quote }}