Skip to content

Commit

Permalink
Merge branch 'development' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfaron committed Oct 11, 2024
2 parents ba08078 + 2d62cd3 commit caadbb1
Show file tree
Hide file tree
Showing 613 changed files with 104,560 additions and 67,877 deletions.
19 changes: 19 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
MYSQL_ROOT_PASSWORD=db>D6~M$4§Y:sChh
MYSQL_USER=aas-server
MYSQL_PASSWORD=60PYRe6Vd8C99u4n

MONGO_INITDB_ROOT_USERNAME=aas-server
MONGO_INITDB_ROOT_PASSWORD=bObXJWW6e8Nh78YF

NEXTCLOUD_MYSQL_ROOT_PASSWORD=H68rJ7h4wJ75PgUY
NEXTCLOUD_MYSQL_PASSWORD=VgpnIrk8jJRj435b
NEXTCLOUD_ADMIN_USER=aas-server
NEXTCLOUD_ADMIN_PASSWORD=5w0vmrkzrwDIDyZs
NEXTCLOUD_TRUSTED_DOMAINS=localhost

NODE_ENV=production
NODE_SERVER_PORT=1337
AAS_INDEX=mysql://aas-server:60PYRe6Vd8C99u4n@aasportal-index:3306
USER_STORAGE=mongodb://aas-server:bObXJWW6e8Nh78YF@aasportal-users:27017/aasportal-users
TEMPLATE_STORAGE=http://aas-server:5w0vmrkzrwDIDyZs@aasportal-cloud:8080/templates
ENDPOINTS=["file:///endpoints/samples?name=Samples"]
64 changes: 15 additions & 49 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,21 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"extends": [
"root": true,
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "lib",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "lib",
"style": "kebab-case"
}
]
}
"plugin:prettier/recommended"
],
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module"
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended",
"plugin:@angular-eslint/template/accessibility"
],
"rules": {}
},
{
"files": [
"*.ts"
],
"extends": [
"plugin:@ngrx/recommended"
]
"rules": {
"@typescript-eslint/no-empty-function": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/explicit-member-accessibility": "error",
"prettier/prettier": "error"
}
]
}
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

**/bin
**/obj
./aas-server/users
./aas-server/test/users
nginx
*.user
*.log
Expand All @@ -38,17 +36,16 @@ coverage
libpeerconnection.log
testem.log
typings
./aas-server-config.json
reports
.nyc_output
temp
*-audit.json
swagger.json
swagger.yaml
projects/aas-server/src/app/routes
/projects/aas-server/src/app/routes
/projects/ass-server/src/assets/app-info.json

# System files
.DS_Store
Thumbs.db
.VSCodeCounter
aas-server-config.json
13 changes: 8 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
variables:
NODE_IMAGE: node:20.11.1-alpine

stages:
- tag
- build
- test
- deploy

tag:
image: node:18.10
image: $NODE_IMAGE
stage: tag
rules:
- if: '$CI_COMMIT_MESSAGE !~ /(Release)/'
Expand All @@ -15,7 +18,7 @@ tag:
- npx semantic-release

build:
image: node:lts-alpine3.16
image: $NODE_IMAGE
stage: build
rules:
- if: '$CI_COMMIT_MESSAGE =~ /(Release)/'
Expand All @@ -24,7 +27,7 @@ build:
- npm run build -ws

test:
image: node:lts-alpine3.16
image: $NODE_IMAGE
stage: test
rules:
- if: '$CI_COMMIT_MESSAGE =~ /(Release)/'
Expand All @@ -39,9 +42,9 @@ test:
paths:
- reports/aas-portal.xml
- reports/aas-server.xml
- reports/common.xml
- reports/aas-core.xml
reports:
junit: [reports/aas-portal.xml, reports/aas-server.xml, reports/common.xml]
junit: [reports/aas-portal.xml, reports/aas-server.xml, reports/aas-core.xml]
coverage_report:
coverage_format: cobertura
path: reports/**/cobertura-coverage.xml
Expand Down
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Ignore everything
**/*

# But not TS and JS files
!**/*.ts
!**/*.js

# Check subdirectories too
!*/
17 changes: 17 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"singleQuote": true,
"trailingComma": "all",
"useTabs": false,
"tabWidth": 4,
"semi": true,
"endOfLine": "auto",
"printWidth": 120,
"quoteProps": "as-needed",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "avoid",
"proseWrap": "preserve",
"embeddedLanguageFormatting": "auto",
"singleAttributePerLine": false
}

45 changes: 39 additions & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
{
"name": "Start aas-server",
"type": "node",
"args": ["--security-revert=CVE-2023-46809"],
"request": "launch",
"preLaunchTask": "build-aas-server",
"program": "${workspaceFolder}/projects/aas-server/build/aas-server.js",
Expand All @@ -28,8 +29,10 @@
"CONTENT_ROOT": "projects/aas-server/build",
"WEB_ROOT": "projects/aas-portal/dist",
"ASSETS": "projects/aas-server/src/assets",
"USER_STORAGE": "mongodb://localhost:27017/aasportal-users",
"ENDPOINTS": "[\"file:///samples?name=Samples\"]"
"ENDPOINTS": "[\"file:///endpoints/samples?name=Samples\"]",
// "USER_STORAGE": "mongodb://aas-server:bObXJWW6e8Nh78YF@localhost:27017/aasportal-users",
// "TEMPLATE_STORAGE": "http://aas-server:5w0vmrkzrwDIDyZs@localhost:8080/templates",
// "AAS_INDEX": "mysql://aas-server:60PYRe6Vd8C99u4n@localhost:3306",
}
},
{
Expand All @@ -47,7 +50,7 @@
"CONTENT_ROOT": "projects/aas-server/dist",
"WEB_ROOT": "projects/aas-portal/dist",
"ASSETS": "projects/aas-server/src/assets",
"ENDPOINTS": "[\"file:///samples?name=Samples\"]"
"ENDPOINTS": "[\"file:///endpoints/samples?name=Samples\"]"
}
},
{
Expand All @@ -72,13 +75,41 @@
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"test:debug",
"test",
"-w",
"aas-server"
],
},
{
"name": "Test common",
"name": "Debug aas-server test",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"test",
"-w",
"aas-server",
"--testPathPattern",
"${fileBasename}"
],
},
{
"name": "Test aas-core",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"test",
"-w",
"aas-core"
]
},
{
"name": "Debug aas-core test",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
Expand All @@ -87,7 +118,9 @@
"run-script",
"test",
"-w",
"common"
"aas-core",
"--testPathPattern",
"${fileBasename}"
]
}
]
Expand Down
22 changes: 22 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"cSpell.words": [
"aaslist",
"AASPORTAL",
"aasv",
"aasv3",
"angewandten",
"autohide",
Expand All @@ -22,16 +24,36 @@
"nicht",
"NMTOKEN",
"NMTOKENS",
"opnxml",
"owncloud",
"preprocessors",
"Qualifiable",
"rechtlich",
"selbstaendige",
"Sematics",
"submodel",
"tsoa",
"tsyringe",
"Ungroup",
"uuid",
"webdav",
"xmldoc",
"ZVEI"
],
"files.eol": "\n",
"jest.debugMode": true,
"jest.virtualFolders": [
{
"name": "aas-core",
"rootPath": "./projects/aas-core",
"runMode": "on-demand",
"jestCommandLine": "node --experimental-vm-modules --no-warnings ../../node_modules/jest/bin/jest.js",
},
{
"name": "aas-server",
"rootPath": "./projects/aas-server",
"runMode": "on-demand",
"jestCommandLine": "node --experimental-vm-modules --no-warnings ../../node_modules/jest/bin/jest.js"
}
]
}
26 changes: 12 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
# Dockerfile to build server and client parts
FROM node:lts-alpine3.16 as build
# Creates an all-in-one Docker image
FROM node:20.11.1-alpine AS build
WORKDIR /usr/src/app
COPY . .
RUN npm install
RUN node create-app-info.js
RUN node --no-warnings --loader ts-node/esm create-app-info.ts
RUN npm run build

FROM node:lts-alpine3.16 as aas-server-app
FROM node:20.11.1-alpine AS aasportal
RUN apk upgrade --update-cache --available && apk add openssl && rm -rf /var/cache/apk/*
WORKDIR /usr/src/app
COPY package.json package.json
COPY projects/aas-server/package.json projects/aas-server/package.json
COPY --from=build /usr/src/app/projects/aas-server/dist/ /usr/src/app/
COPY --from=build /usr/src/app/projects/aas-server/app-info.json /usr/src/app/app-info.json
COPY --from=build /usr/src/app/projects/common/dist/ /usr/src/app/node_modules/common/dist/
COPY --from=build /usr/src/app/projects/common/package.json /usr/src/app/node_modules/common/package.json
COPY --from=build /usr/src/app/projects/aas-portal/dist/ /usr/src/app/wwwroot
RUN npm install -w=aas-server --omit=dev
COPY projects/aas-server/src/assets assets/
COPY --from=build /usr/src/app/projects/aas-server/package.json package.json
RUN npm install --omit=dev
COPY --from=build /usr/src/app/projects/aas-server/src/assets assets/
COPY --from=build /usr/src/app/projects/aas-server/dist/ .
COPY --from=build /usr/src/app/projects/aas-core/dist/ node_modules/aas-core/dist/
COPY --from=build /usr/src/app/projects/aas-core/package.json node_modules/aas-core/package.json
COPY --from=build /usr/src/app/projects/aas-portal/dist/browser/ wwwroot/
ENV NODE_LOG=./log/debug.log
ENV NODE_SERVER_PORT=80
ENV ENDPOINTS=["\"file:///samples?name=Samples\""]
ENV ENDPOINTS=["\"file:///endpoints/samples?name=Samples\""]
ENV NODE_ENV=production

EXPOSE 80
Expand Down
12 changes: 7 additions & 5 deletions Dockerfile.aas-portal
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Dockerfile to build server and client parts
FROM node:lts-alpine3.16 as build
# Dockerfile to build client app
FROM node:20.11.1-alpine AS build
WORKDIR /usr/src/app
COPY . .
RUN npm install
RUN npm run aas-portal:build

FROM nginx:latest as aas-portal
COPY --from=build /usr/src/app/projects/aas-portal/dist/ /usr/share/nginx/html/
FROM nginx:latest AS aas-portal
#possibility to check host & port availability of other containers via netcat
RUN apt-get update -y && apt-get install -y netcat-openbsd
COPY --from=build /usr/src/app/projects/aas-portal/dist/browser/ /usr/share/nginx/html/
COPY --from=build /usr/src/app/projects/aas-portal/nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
EXPOSE 80
Loading

0 comments on commit caadbb1

Please sign in to comment.