Skip to content

Commit

Permalink
Merge branch 'main' into bh/participant-updated-split
Browse files Browse the repository at this point in the history
# Conflicts:
#	server/api.postman_collection.json
#	server/src/api/boards.go
#	server/src/api/event_filter_test.go
  • Loading branch information
Schwehn42 committed Oct 11, 2024
2 parents 27b6d2c + fccbb16 commit 18e22fa
Show file tree
Hide file tree
Showing 465 changed files with 13,117 additions and 7,641 deletions.
2 changes: 1 addition & 1 deletion .github/actions/deployment_health_check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ runs:
lastCurlExitCode=-1
until [ $retry -gt $max_retries ]
do
response=$(curl -s -k -o /dev/null -w "%{http_code}" "${{ inputs.HEALTH_URL }}")
response=$(curl --max-time 10 -s -k -o /dev/null -w "%{http_code}" "${{ inputs.HEALTH_URL }}")
lastCurlExitCode=$?
if [ $response = "204" ]; then
echo "Cluster is healthy! Continuing..."
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
id: yarn-cache
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
- name: Go lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.54
version: v1.61
working-directory: ./server/src/

- name: Build server
Expand All @@ -96,19 +96,19 @@ jobs:
package:
needs: [test-frontend, test-backend]
uses: inovex/scrumlr.io/.github/workflows/package.yml@main
uses: ./.github/workflows/package.yml

deploy_to_dev_cluster:
needs: package
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.user.login != 'dependabot[bot]' || github.ref_name == 'main' }}
uses: inovex/scrumlr.io/.github/workflows/deploy_to_dev_cluster.yml@main
uses: ./.github/workflows/deploy_to_dev_cluster.yml
secrets: inherit
with:
frontend_image_tag: ${{ needs.package.outputs.frontend-image-tag }}
server_image_tag: ${{ needs.package.outputs.server-image-tag }}

docs_changes:
if : ${{ github.ref == 'refs/heads/main' }}
if : ${{ github.event_name == 'pull_request' && github.event.pull_request.user.login != 'dependabot[bot]' || github.ref_name == 'main' }}
runs-on: ubuntu-latest
steps:
- name: checkout repository
Expand All @@ -129,7 +129,7 @@ jobs:
deploy_github_pages:
needs: docs_changes
if: ${{ needs.docs_changes.outputs.docs_changed == 'true' }}
uses: inovex/scrumlr.io/.github/workflows/deploy_docs.yml@main
uses: ./.github/workflows/deploy_docs.yml
secrets: inherit
deployment_health_check:
needs: deploy_to_dev_cluster
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
deploy:
needs: build
runs-on: ubuntu-latest
if: ${{ github.ref_name == 'main' }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy_to_dev_cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ jobs:
pull-requests: write
steps:
- name: Install kubectl
uses: azure/setup-kubectl@v3
uses: azure/setup-kubectl@v4
id: install
- name: Set up Kubernetes Auth
uses: azure/k8s-set-context@v3
uses: azure/k8s-set-context@v4
with:
method: service-account
k8s-secret: ${{ secrets.KUBERNETES_SECRET }}
k8s-url: https://kubernetes.default.svc

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Replace template variables
run: |
Expand All @@ -50,7 +50,7 @@ jobs:
cat k8s/deployment.yaml
- name: Deploy to dev cluster
uses: Azure/k8s-deploy@v4
uses: Azure/k8s-deploy@v5
with:
namespace: scrumlr-dev-deployments
force: true
Expand Down
101 changes: 73 additions & 28 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,50 @@ on:
outputs:
frontend-image-tag:
description: The tag of the frontend image
value: ${{ jobs.package.outputs.frontend-image-tag }}
value: ${{ jobs.package-frontend.outputs.frontend-image-tag }}
server-image-tag:
description: The tag of the server image
value: ${{ jobs.package.outputs.server-image-tag }}


value: ${{ jobs.package-server.outputs.server-image-tag }}

jobs:
package:
determine-platforms:
runs-on: ubuntu-latest
outputs:
platforms: ${{ steps.platforms.outputs.platforms }}
steps:
- name: Set platforms
id: platforms
run: |
if [ "${{ github.event_name }}" == "release" ]; then
echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
else
echo "platforms=linux/amd64" >> $GITHUB_OUTPUT
fi
package-frontend:
needs: determine-platforms
outputs:
frontend-image-tag: ${{ steps.outputs.outputs.frontend-image-tag }}
server-image-tag: ${{ steps.outputs.outputs.server-image-tag }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

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

- name: Log in to GitHub container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: scrumlr.io - Frontend image meta information
id: meta-frontend
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/inovex/scrumlr.io/scrumlr-frontend
Expand All @@ -53,9 +67,50 @@ jobs:
org.opencontainers.image.title=scrumlr.io Frontend
org.opencontainers.image.description=The web client for scrumlr.io
- name: Build and push frontend images
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: ${{ needs.determine-platforms.outputs.platforms }}
push: true
tags: ${{ steps.meta-frontend.outputs.tags }}
labels: ${{ steps.meta-frontend.outputs.labels }}
cache-from: type=registry,ref=ghcr.io/inovex/scrumlr.io/scrumlr-frontend:cache
cache-to: type=registry,ref=ghcr.io/inovex/scrumlr.io/scrumlr-frontend:cache,mode=max

- name: Set outputs
id: outputs
run: |
echo $DOCKER_METADATA_OUTPUT_TAGS
echo _____________________________________________________
echo frontend-image-tag=$(echo "$(echo $DOCKER_METADATA_OUTPUT_TAGS | grep -oP 'sha-[a-f0-9]+')" ) >> $GITHUB_OUTPUT
package-server:
needs: determine-platforms
outputs:
server-image-tag: ${{ steps.outputs.outputs.server-image-tag }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Log in to GitHub container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: scrumlr.io - Server image meta information
id: meta-server
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/inovex/scrumlr.io/scrumlr-server
Expand All @@ -74,31 +129,21 @@ jobs:
org.opencontainers.image.title=scrumlr.io Server
org.opencontainers.image.description=The server for scrumlr.io
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v2

- name: Push frontend image
id: push-frontend
uses: docker/build-push-action@v4

with:
push: true
tags: ${{ steps.meta-frontend.outputs.tags }}
labels: ${{ steps.meta-frontend.outputs.labels }}

- name: Push server image
id: push-server
uses: docker/build-push-action@v4
- name: Build and push server images
uses: docker/build-push-action@v6
with:
context: ./server/src
file: ./server/src/Dockerfile
platforms: ${{ needs.determine-platforms.outputs.platforms }}
push: true
tags: ${{ steps.meta-server.outputs.tags }}
labels: ${{ steps.meta-server.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Set outputs
id: outputs
run: |
echo $DOCKER_METADATA_OUTPUT_TAGS
echo __________________________________________________________________
echo frontend-image-tag=$(echo "$(echo $DOCKER_METADATA_OUTPUT_TAGS | grep -oP 'sha-[a-f0-9]+')") >> $GITHUB_OUTPUT
echo server-image-tag=$(echo "$(echo $DOCKER_METADATA_OUTPUT_TAGS | grep -oP 'sha-[a-f0-9]+')") >> $GITHUB_OUTPUT
echo _____________________________________________________
echo server-image-tag=$(echo "$(echo $DOCKER_METADATA_OUTPUT_TAGS | grep -oP 'sha-[a-f0-9]+')" ) >> $GITHUB_OUTPUT
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ on:

jobs:
package:
uses: inovex/scrumlr.io/.github/workflows/package.yml@main
uses: ./.github/workflows/package.yml


1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ yarn-error.log*

# testing
/coverage
server/src/coverage.txt

# builds
build
Expand Down
22 changes: 2 additions & 20 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,20 +1,2 @@
#!/usr/bin/env sh

HUSKY_SH="$(dirname -- "$0")/_/husky.sh"

if [ ! -f "$HUSKY_SH" ]; then
>&2 echo "$HUSKY_SH does not exist. run 'yarn install'"
exit 1
fi

# shellcheck disable=SC1090
. "$HUSKY_SH"

set -eu

SCRIPT_DIRECTORY="$(dirname -- "$( readlink -f -- "$0"; )";)"

PATH="$PATH:$SCRIPT_DIRECTORY/../node_modules/.bin"

echo "... about to format staged files for client"
lint-staged
echo "pre-commit: formatting code ..."
yarn lint-staged
7 changes: 7 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"rules": {
"color-no-hex": true,
"color-named": "never"
},
"ignoreFiles": ["src/constants/style.scss"]
}
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM node:lts-hydrogen as build-stage
FROM node:hydrogen-alpine AS build-stage

WORKDIR /usr/src/app

COPY package.json yarn.lock ./
RUN yarn install

RUN yarn install --network-timeout 240000

COPY src/ src/
COPY public/ public/
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ Thanks to all our users, collaborators, contributors & supporters! ❤️
[<img src="https://avatars.githubusercontent.com/u/54246641?v=4" width="48" height="48" alt="Quasilius-Starlord">](https://github.com/Quasilius-Starlord)
[<img src="https://avatars.githubusercontent.com/u/52677920?v=4" width="48" height="48" alt="mateo-ivc">](https://github.com/mateo-ivc)
[<img src="https://avatars.githubusercontent.com/u/56827034?v=4" width="48" height="48" alt="fabi1999">](https://github.com/fabi1999)
[<img src="https://avatars.githubusercontent.com/u/58568446?v=4" width="48" height="48" alt="liza-kl">](https://github.com/liza-kl)


... and many more!

Expand Down
2 changes: 2 additions & 0 deletions deployment/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
jwt.key
2 changes: 1 addition & 1 deletion deployment/SKE/create_db_job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
spec:
containers:
- name: create-db
image: postgres:15-alpine
image: postgres:16.4-alpine
env:
- name: DB_URL
value: "$DB_URL"
Expand Down
4 changes: 4 additions & 0 deletions deployment/docker/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
ANALYTICS_DATA_DOMAIN=
ANALYTICS_SRC=
# Auth Providers
AUTH_CALLBACK_HOST=
APPLE_CLIENT_ID=
APPLE_CLIENT_SECRET=
AZURE_AD_CLIENT_ID=
Expand All @@ -16,6 +17,9 @@ GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
MICROSOFT_CLIENT_ID=
MICROSOFT_CLIENT_SECRET=
OIDC_CLIENT_ID=
OIDC_CLIENT_SECRET=
OIDC_DISCOVERY_URL=http://oidc.localhost:5556/dex/.well-known/openid-configuration
# Your Postgres Password
POSTGRES_PASSWORD=
# Redis if you use it instead of NATS
Expand Down
14 changes: 14 additions & 0 deletions deployment/docker/Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
0.0.0.0:80 {
log {
output stdout
}
@api {
path /api*
}
reverse_proxy @api scrumlr-backend:8080

@frontend {
path / /static* /locales* /login* /board* /new* /timer_finished.mp3 /hotkeys.pdf /legal/* /manifest.json /service-worker.js
}
reverse_proxy @frontend scrumlr-frontend:8080
}
26 changes: 26 additions & 0 deletions deployment/docker/dex.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---

issuer: 'http://oidc.localhost:5556/dex'

storage:
type: memory

web:
http: '0.0.0.0:5556'

staticClients:
- id: ''
redirectURIs:
- 'http://localhost:8080/api/login/oidc/callback'
name: ''
secret: ''

enablePasswordDB: true
staticPasswords:
- email: ''
# bcrypt hash of the string "password": $(echo password | htpasswd -BinC 10 admin | cut -d: -f2)
hash: ''
username: ''
userID: ''


Loading

0 comments on commit 18e22fa

Please sign in to comment.