Skip to content

Commit 4bf0738

Browse files
committed
Merge branch 'dev'
2 parents fb3d834 + a715707 commit 4bf0738

File tree

165 files changed

+14246
-19252
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+14246
-19252
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ server/database/.tmp.*
1313

1414
# Docker stuff
1515
postgres-data
16+
.env
1617

1718
# Backups
18-
*.sql.gz
19+
*.sql.gz
20+
21+
# Example files
22+
example*

build.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
3+
# Exit on errors
4+
set -e
5+
6+
# First parameter must be tag name
7+
if [ -z $1 ]
8+
then
9+
echo "ERROR: Specify tag name."
10+
echo
11+
echo "Example:"
12+
echo
13+
echo " $(basename $0) \"0.8.0-dev\""
14+
exit 1
15+
fi
16+
TAG=$1
17+
18+
function ok {
19+
echo
20+
echo "OK"
21+
}
22+
23+
function hline {
24+
echo
25+
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
26+
echo " $1"
27+
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
28+
echo
29+
}
30+
31+
hline "[1/4] Build server"
32+
docker build -t simpletaskmanager/stm-server:$TAG server
33+
ok
34+
35+
hline "[2/4] Build Client"
36+
echo "This step might take a while..."
37+
echo
38+
docker build -t simpletaskmanager/stm-client:$TAG client
39+
ok
40+
41+
hline "[3/4] Push server"
42+
docker push simpletaskmanager/stm-server:$TAG
43+
ok
44+
45+
hline "[4/4] Push client"
46+
docker push simpletaskmanager/stm-client:$TAG
47+
ok
48+
49+
echo
50+
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
51+
echo
52+
echo "DONE"

client/Dockerfile

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
1-
## Stage 1 : Install dependencies
2-
FROM node:15.7.0 as builder
1+
# Stage 1: Buil
2+
FROM node:16-alpine AS builder
33

4-
RUN mkdir /stm-client
4+
COPY . /stm-client
55
WORKDIR /stm-client/
66

77
COPY package.json /stm-client/package.json
88
COPY package-lock.json /stm-client/package-lock.json
99

1010
RUN npm install
1111

12+
RUN NODE_OPTIONS="--max_old_space_size=4096" npm run build
1213

13-
14-
## STAGE 2 : Build the client
15-
COPY ./ ./
16-
RUN NODE_OPTIONS="--max_old_space_size=4096" npm run build-prod
17-
18-
19-
20-
## STAGE 3 : Configure nginx and run client
21-
FROM nginx:1.19.6
22-
23-
COPY nginx.conf /etc/nginx/conf.d/default.conf
14+
# Stage 2: Run
15+
FROM nginx:1.21.1-alpine
2416

2517
RUN rm -rf /usr/share/nginx/html/*
26-
COPY --from=builder ./stm-client/dist/simple-task-manager /usr/share/nginx/html
18+
COPY --from=builder /stm-client/dist/simple-task-manager /usr/share/nginx/html
2719

28-
CMD [ "nginx", "-g", "daemon off;" ]
20+
ENTRYPOINT nginx -g 'daemon off;'

client/Dockerfile-test

Lines changed: 0 additions & 28 deletions
This file was deleted.

client/README.ja.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ UIが更新され、source messages.xlfが変更されたら、ステップ3 - 6
9191

9292
```json
9393
"projects": {
94-
"simple-task-manager": {
94+
"simple-task-dashboard": {
9595
"i18n": {
9696
"sourceLocale": "en-US",
9797
"locales": {
@@ -122,15 +122,15 @@ UIが更新され、source messages.xlfが変更されたら、ステップ3 - 6
122122
"serve": {
123123
"configurations": {
124124
"production": {
125-
"browserTarget": "simple-task-manager:build:production"
125+
"browserTarget": "simple-task-dashboard:build:production"
126126
},
127127
"ja": {
128-
"browserTarget": "simple-task-manager:build:ja"
128+
"browserTarget": "simple-task-dashboard:build:ja"
129129
},
130130
"de": {
131-
"browserTarget": "simple-task-manager:build:de"
131+
"browserTarget": "simple-task-dashboard:build:de"
132132
},
133133
"<langID>": {
134-
"browserTarget": "simple-task-manager:build:<langID>"
134+
"browserTarget": "simple-task-dashboard:build:<langID>"
135135
}
136136
```

client/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ See the [development README](../doc/development/README.md) for details.
5353
5454
# Configuration
5555
56-
Currently the client has a very simple dev- and prod-configuration in `client/src/environments`.
56+
The client has a dev-, local- and prod-configuration in `client/src/environments`.
57+
The dev-environment is the default one, the local-environment uses a locally hosted authentication server and the prod-environment is used for deployment on a server.
5758
5859
Encryption (HTTPS) and HTTP-Server configs depend on the used HTTP-Server (Apache-HTTP, nginx, ...), so take a look at their documentation or at the `./client/nginx.conf` for my nginx config used in the `stm-client` docker container.
5960
@@ -97,7 +98,7 @@ To tell the Angular-compiler about the new language, add the following three par
9798

9899
```json
99100
"projects": {
100-
"simple-task-manager": {
101+
"simple-task-dashboard": {
101102
"i18n": {
102103
"sourceLocale": "en-US",
103104
"locales": {
@@ -128,15 +129,15 @@ To tell the Angular-compiler about the new language, add the following three par
128129
"serve": {
129130
"configurations": {
130131
"production": {
131-
"browserTarget": "simple-task-manager:build:production"
132+
"browserTarget": "simple-task-dashboard:build:production"
132133
},
133134
"ja": {
134-
"browserTarget": "simple-task-manager:build:ja"
135+
"browserTarget": "simple-task-dashboard:build:ja"
135136
},
136137
"de": {
137-
"browserTarget": "simple-task-manager:build:de"
138+
"browserTarget": "simple-task-dashboard:build:de"
138139
},
139140
"<langID>": {
140-
"browserTarget": "simple-task-manager:build:<langID>"
141+
"browserTarget": "simple-task-dashboard:build:<langID>"
141142
}
142143
```

client/angular.json

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -122,34 +122,7 @@
122122
},
123123
{
124124
"type": "anyComponentStyle",
125-
"maximumWarning": "10kb",
126-
"maximumError": "15kb"
127-
}
128-
]
129-
},
130-
"test": {
131-
"fileReplacements": [
132-
{
133-
"replace": "src/environments/environment.ts",
134-
"with": "src/environments/environment.test.ts"
135-
}
136-
],
137-
"optimization": true,
138-
"outputHashing": "all",
139-
"sourceMap": false,
140-
"namedChunks": false,
141-
"extractLicenses": true,
142-
"vendorChunk": false,
143-
"buildOptimizer": false,
144-
"budgets": [
145-
{
146-
"type": "initial",
147-
"maximumWarning": "12mb",
148-
"maximumError": "15mb"
149-
},
150-
{
151-
"type": "anyComponentStyle",
152-
"maximumWarning": "9kb",
125+
"maximumWarning": "12kb",
153126
"maximumError": "15kb"
154127
}
155128
]
@@ -166,9 +139,6 @@
166139
"local": {
167140
"browserTarget": "simple-task-manager:build:local"
168141
},
169-
"test": {
170-
"browserTarget": "simple-task-manager:build:test"
171-
},
172142
"production": {
173143
"browserTarget": "simple-task-manager:build:production"
174144
},
@@ -219,25 +189,12 @@
219189
"options": {
220190
"tsConfig": [
221191
"tsconfig.app.json",
222-
"tsconfig.spec.json",
223-
"e2e/tsconfig.json"
192+
"tsconfig.spec.json"
224193
],
225194
"exclude": [
226195
"**/node_modules/**"
227196
]
228197
}
229-
},
230-
"e2e": {
231-
"builder": "@angular-devkit/build-angular:protractor",
232-
"options": {
233-
"protractorConfig": "e2e/protractor.conf.js",
234-
"devServerTarget": "simple-task-manager:serve"
235-
},
236-
"configurations": {
237-
"production": {
238-
"devServerTarget": "simple-task-manager:serve:production"
239-
}
240-
}
241198
}
242199
}
243200
}

client/karma.conf.js

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// Karma configuration file, see link for more information
2-
// https://karma-runner.github.io/1.0/config/configuration-file.html
1+
// Karma configuration
2+
// Generated on Fri Oct 01 2021 23:14:14 GMT+0200 (Mitteleuropäische Sommerzeit)
33

4-
module.exports = function (config) {
4+
module.exports = function(config) {
55
config.set({
66
basePath: '',
77
frameworks: ['jasmine', '@angular-devkit/build-angular'],
@@ -13,11 +13,13 @@ module.exports = function (config) {
1313
require('karma-coverage'),
1414
require('@angular-devkit/build-angular/plugins/karma')
1515
],
16-
client: {
17-
clearContext: false // leave Jasmine Spec Runner output visible in browser
18-
},
16+
files: [
17+
'./**/*.spec.ts'
18+
],
19+
exclude: [ ],
20+
preprocessors: { },
1921
coverageReporter: {
20-
dir: require('path').join(__dirname, './coverage/simple-task-manager'),
22+
dir: require('path').join(__dirname, './coverage/simple-task-dashboard'),
2123
reporters: [
2224
{ type: 'html', subdir: 'report-html' },
2325
{ type: 'lcov', subdir: 'report-lcov' },
@@ -27,17 +29,24 @@ module.exports = function (config) {
2729
reporters: ['progress', 'kjhtml'],
2830
port: 9876,
2931
colors: true,
30-
logLevel: config.LOG_DEBUG,
32+
logLevel: config.LOG_INFO,
3133
autoWatch: true,
32-
browsers: ['ChromeHeadlessNoSandbox', 'FirefoxHeadless'],
33-
customLaunchers: {
34-
ChromeHeadlessNoSandbox: {
35-
base: 'ChromeHeadless',
36-
flags: ['--no-sandbox']
37-
}
34+
browsers: ['HeadlessFirefox'],
35+
customLaunchers: {
36+
ChromeHeadlessNoSandbox: {
37+
base: 'ChromeHeadless',
38+
flags: ['--no-sandbox']
39+
},
40+
HeadlessFirefox: {
41+
base: 'FirefoxHeadless',
42+
flags: [
43+
'-headless',
44+
],
45+
}
3846
},
3947
singleRun: false,
4048
restartOnFileChange: true,
41-
browserNoActivityTimeout: 900 * 1000 // 15 min.
42-
});
43-
};
49+
browserNoActivityTimeout: 900 * 1000, // 15 min.
50+
concurrency: Infinity,
51+
})
52+
}

0 commit comments

Comments
 (0)