Skip to content

Commit

Permalink
Merge branch 'main' into feature/disable-identity-auto-creation-add-a…
Browse files Browse the repository at this point in the history
…dmin-cli
  • Loading branch information
sebbi08 committed Jul 12, 2024
2 parents 45f566c + 477b6df commit ff1d98c
Show file tree
Hide file tree
Showing 34 changed files with 16,626 additions and 2,803 deletions.
17 changes: 10 additions & 7 deletions .ci/buildAndPush.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ if [ -z "$(which jq)" ]; then
exit 1
fi

PACKAGE_VERSION=$(jq .version -r package.json)
if [ -z "$VERSION" ]; then
echo "The environment variable 'VERSION' must be set."
exit 1
fi

case "$PACKAGE_VERSION" in
case "$VERSION" in
*-alpha*) BASE_TAG=alpha ;;
*-beta*) BASE_TAG=beta ;;
*-rc*) BASE_TAG=rc ;;
Expand All @@ -21,13 +24,13 @@ REPO="ghcr.io/nmshd/connector"

TAGS="-t $REPO:$BUILD_NUMBER -t $REPO:$COMMIT_HASH"

OUTPUT="$(DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect $REPO:${PACKAGE_VERSION} 2>&1)" || true
OUTPUT="$(DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect $REPO:${VERSION} 2>&1)" || true
if [[ $OUTPUT =~ (no such manifest: ghcr.io/nmshd/connector:) ]] || [[ $OUTPUT == "manifest unknown" ]]; then # manifest not found -> push
echo "pushing tag '${BASE_TAG}' and '${PACKAGE_VERSION}'"
echo "pushing tag '${BASE_TAG}' and '${VERSION}'"

TAGS="$TAGS -t $REPO:$BASE_TAG -t $REPO:$PACKAGE_VERSION"
TAGS="$TAGS -t $REPO:$BASE_TAG -t $REPO:$VERSION"
elif [[ $OUTPUT =~ (\{) ]]; then # manifest found -> ignore
echo "image '$PACKAGE_VERSION' already exists"
echo "image '$VERSION' already exists"
else # other error
echo $OUTPUT
fi
Expand All @@ -37,4 +40,4 @@ docker buildx build --push --provenance=true --sbom=true \
$TAGS \
--build-arg COMMIT_HASH=$COMMIT_HASH \
--build-arg BUILD_NUMBER=$BUILD_NUMBER \
--build-arg PACKAGE_VERSION=$PACKAGE_VERSION .
--build-arg VERSION=$VERSION .
9 changes: 6 additions & 3 deletions .ci/publishHelmChart.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
PACKAGE_VERSION=$(jq .version -r package.json)
if [ -z "$VERSION" ]; then
echo "The environment variable 'VERSION' must be set."
exit 1
fi

helm package --app-version $PACKAGE_VERSION --version $PACKAGE_VERSION ./helmChart
helm package --app-version $VERSION --version $VERSION ./helmChart

HELM_PATH="./connector-helm-chart-$PACKAGE_VERSION.tgz"
HELM_PATH="./connector-helm-chart-$VERSION.tgz"
REGISTRY="oci://ghcr.io/nmshd"

echo "deploying '$HELM_PATH' to oci REGISTRY '$REGISTRY'"
Expand Down
6 changes: 6 additions & 0 deletions .ci/publishNpm.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
set -e
set -x

if [ -z "$VERSION" ]; then
echo "The environment variable 'VERSION' must be set."
exit 1
fi

cd packages/sdk
npm version $VERSION
npx enhanced-publish --if-possible --use-preid-as-tag
4 changes: 2 additions & 2 deletions .ci/testBuildingProductiveDockerImage.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
COMMIT_HASH=c
BUILD_NUMBER=b
PACKAGE_VERSION=p
VERSION=v

docker build --no-cache --progress=plain \
--tag ghcr.io/nmshd/connector:prod \
--build-arg COMMIT_HASH=$COMMIT_HASH \
--build-arg BUILD_NUMBER=$BUILD_NUMBER \
--build-arg PACKAGE_VERSION=$PACKAGE_VERSION .
--build-arg VERSION=$VERSION .
8 changes: 4 additions & 4 deletions .ci/writeBuildInformation.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
set -e

if [ -z "$PACKAGE_VERSION" ]; then
echo "The environment variable 'PACKAGE_VERSION' must be set."
if [ -z "$VERSION" ]; then
echo "The environment variable 'VERSION' must be set."
exit 1
fi

Expand All @@ -21,12 +21,12 @@ DATE=$(date -u --iso-8601=seconds)
TARGET_FILE="./dist/buildInformation.js"

echo "Writing the following properties into $TARGET_FILE"
echo " - VERSION: $PACKAGE_VERSION"
echo " - VERSION: $VERSION"
echo " - BUILD_NUMBER: $BUILD_NUMBER"
echo " - COMMIT_HASH: $COMMIT_HASH"
echo " - DATE: $DATE"

sed -i "s/{{version}}/$PACKAGE_VERSION/" $TARGET_FILE
sed -i "s/{{version}}/$VERSION/" $TARGET_FILE
sed -i "s/{{build}}/$BUILD_NUMBER/" $TARGET_FILE
sed -i "s/{{commit}}/$COMMIT_HASH/" $TARGET_FILE
sed -i "s/{{date}}/$DATE/" $TARGET_FILE
2 changes: 1 addition & 1 deletion .dev/Dockerfile.debug
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.11.0
FROM node:22.4.0
WORKDIR /usr/app

# Webserver, Debugger
Expand Down
13 changes: 12 additions & 1 deletion .dev/appsettings.override.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"Authentication": {
"JwtSigningCertificate": "MIIJ/wIBAzCCCbUGCSqGSIb3DQEHAaCCCaYEggmiMIIJnjCCBAoGCSqGSIb3DQEHBqCCA/swggP3AgEAMIID8AYJKoZIhvcNAQcBMF8GCSqGSIb3DQEFDTBSMDEGCSqGSIb3DQEFDDAkBBCPqAJskE1tYnX41O3DfagGAgIIADAMBggqhkiG9w0CCQUAMB0GCWCGSAFlAwQBKgQQV2BFkuXPtSrajdHwKU1KKoCCA4DMA/JkSD9Iph3Aiq8qxM1mCzZKab63aseb8hJvBUdnZCIobWCiGJOlV/QcwS9RoZOVOR8fiB60tsFz4HMS9QVl0kVkautmg+trSii0riXucVl5zyabLBiABmIdfo6UV7pcd9POewMrpJ2vPKTyHcBeENIqQMp9Il4sAQRgKIvqb/Z61VD9+qCbZYzBV3brHK0jdOir4Ye54zgmRMX3K4i4uPgO+QWt3Ot8P3dItdndNvB4rKJmjb7l/dBAJQv8Q/+wgZE7SzQSPT6iWmmQ2auoF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+LKaL4KnTAHSdsQo8p26fbAonJ08Utqwk0yWDI62ma6DWvq5bR9FEXNejWsa1Pt11RxlRPZR5mvIyoi2Q+X/AQlHRLe3Ft8AK702Q4dyfojx4MBAhmNdRSstqEXoQj2beRUQ5RxpjqTOo9S0/q1+PnM5j01AMcsLDIDwmJUzGrko4V6jTfaZgNSJY4yRnqBSFYZcjYhZBKFOGs2ZlqOQq9R3f+vSCitVSvfXJB/c+knuEaJRqjxt6B7pZ8T1MFcorahYh1kGyTu/JaklSq3ZgrrrAFxIG7v2247KaN1upg4FJaJiO3WZay8yVk1xRZLZkscR/MFY5LFPRhMrxfP5lyz8RgQKjPgSBW5xdfnBw55L72Ogorfo5I3/sGdnvxxoDh759hdiyyomsGxtKa/Vy7iTlJoy2gY/IatE/U5Jvb+y4WJhjZlzzNbyoTVHThaOxSmkf0qve/hb3/Emjn31i4E/UeRtgkPWQ9hNfGdZgwXyZmHft5TjuHavPUNKunOd7Up2si+lpEGOPesO0/eAb60FLZ/TEuEavEoVZW1WE2MKxdrdXvlyVauhcZ4MmpJvgEjK0BpTuxvNe9UQMGlltYq7zSB43e34zgyEfjEiHiMSUwIwYJKoZIhvcNAQkVMRYEFI9W3hOOq15cKT/TSo/TvKsXNL+GMEEwMTANBglghkgBZQMEAgEFAAQgTDQoVupf9X13ECnEqaEryflDawino/d9Xtc2JdR9dyEECJvTJ/AbI65mAgIIAA=="
},
"Cors": {
"allowedOrigins": "nmshd://prod;http://localhost:3090;localhost:3090;nmshd://",
"exposedHeaders": "X-Request-Time;X-Response-Time;X-Response-Duration-ms;X-Trace-Id"
},
"Infrastructure": {
"EventBus": {
"Vendor": "RabbitMQ",
Expand Down Expand Up @@ -36,7 +43,11 @@
"ConnectionString": "User ID=devices;Password=Passw0rd;Server=postgres;Port=5432;Database=enmeshed;"
},
"PushNotifications": {
"Provider": "Dummy"
"Providers": {
"Dummy": {
"Enabled": true
}
}
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion .dev/compose.backbone.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
BACKBONE_VERSION=5.4.0
BACKBONE_VERSION=5.9.1
5 changes: 4 additions & 1 deletion .dev/compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
version: "3.7"
services:
connector-1:
build:
context: .
dockerfile: ./Dockerfile.debug
container_name: connector-1
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "3000:80" # Webserver
- "9229:9229" # Debugger
Expand All @@ -29,6 +30,8 @@ services:
context: .
dockerfile: ./Dockerfile.debug
container_name: connector-2
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "3001:80" # Webserver
- "9231:9229" # Debugger
Expand Down
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Readiness checklist

- [ ] I added/updated tests.
- [ ] I ensured that the PR title is good enough for the changelog.
- [ ] I labeled the PR.
52 changes: 52 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
version: 2
updates:
##### GitHub Actions #####
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
update-github-actions-dependencies:
patterns:
- "*"
reviewers:
- "jkoenig134"
- "sebbi08"
labels:
- "dependencies"

##### npm #####
- package-ecosystem: "npm"
directories:
- "/"
- "/packages/sdk"
schedule:
interval: "weekly"
groups:
update-npm-dependencies:
patterns:
- "*"
exclude-patterns:
- "@nmshd/runtime"
reviewers:
- "jkoenig134"
- "sebbi08"
labels:
- "dependencies"

##### Docker #####
- package-ecosystem: "docker"
directories:
- "/"
- "/.dev"
schedule:
interval: "weekly"
groups:
update-docker-dependencies:
patterns:
- "*"
reviewers:
- "jkoenig134"
- "sebbi08"
labels:
- "dependencies"
21 changes: 21 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
changelog:
exclude:
labels:
- ci
- chore
- dependencies
- refactor
- test
categories:
- title: Breaking Changes
labels:
- breaking-change
- title: New Features
labels:
- enhancement
- title: Bug Fixes
labels:
- bug
- title: Other Changes
labels:
- "*"
17 changes: 17 additions & 0 deletions .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Check Pull Request

on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]

jobs:
validate-pr-label:
name: Validate the Pull Request's labels
runs-on: ubuntu-latest
steps:
- name: PR must be labeled
uses: jesusvasquez333/[email protected]
with:
disable-reviews: true
github-token: "${{ secrets.GITHUB_TOKEN }}"
valid-labels: "breaking-change, bug, chore, ci, dependencies, documentation, enhancement, refactoring, test"
8 changes: 6 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish

on:
push:
branches: [main, release/**]
tags: "*"

jobs:
run-checks:
Expand All @@ -20,13 +20,14 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: current
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build:ci --workspaces --if-present
- run: bash .ci/publishNpm.sh
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
VERSION: ${{ github.ref_name }}
needs: ["run-checks"]

publish-docker:
Expand All @@ -50,6 +51,7 @@ jobs:
env:
BUILD_NUMBER: ${{ github.run_number }}
COMMIT_HASH: ${{ github.sha }}
VERSION: ${{ github.ref_name }}
needs: ["run-checks"]

publish-helm:
Expand All @@ -65,4 +67,6 @@ jobs:
USER: ${{ github.actor }}
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- run: bash .ci/publishHelmChart.sh
env:
VERSION: ${{ github.ref_name }}
needs: ["publish-docker"]
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
run: npm run start:backbone
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: current
- run: npm ci
- run: npm run build:ci --workspaces --if-present
- name: Start MongoDB
Expand All @@ -38,7 +38,7 @@ jobs:
run: npm run start:backbone
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: current
- run: npm ci
- run: npm run build:ci --workspaces --if-present
- uses: js-soft/[email protected]
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/version-check.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ local.config.json
.gitmodules
packages/runtime
!packages/runtime/*
.env
.local
test/manualTest.ts
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## Discontinued

This changelog is discontinued in favor of the [GitHub Releases](https://github.com/nmshd/connector/releases)

## 3.11.4

- health checks now use `https_proxy` if set

## 3.11.3

- upgrade the runtime version to 4.10.6

## 3.11.2

- upgrade nodejs to 22.2.0

## 3.11.1

- upgrade nodejs to 20.13.1

## 3.11.0

-> SDK 4.3.0
Expand Down
Loading

0 comments on commit ff1d98c

Please sign in to comment.