@@ -12,8 +12,9 @@ example content for the different templates.
12
12
` index.html ` serves a local setup for working with the templates.
13
13
14
14
``` bash
15
- docker-compose run --rm node yarn
16
- docker-compose up -d
15
+ docker compose pull
16
+ docker compose run --rm node yarn
17
+ docker compose up --detach
17
18
```
18
19
19
20
The docker setup serves the files in the ` build/ ` (see build for production) folder as ` display-templates.local.itkdev.dk/build/ ` .
@@ -46,26 +47,62 @@ Add it to `const entry = {}`:
46
47
To build the templates for production
47
48
48
49
``` bash
49
- docker-compose run --rm node yarn build
50
+ docker compose run --rm node yarn install
51
+ docker compose run --rm node yarn build
50
52
```
51
53
52
54
To continually build components when files change
53
55
54
56
``` bash
55
- docker- compose run --rm node yarn build-watch
57
+ docker compose run --rm node yarn build-watch
56
58
```
57
59
58
60
The compiled files will be placed in ` build/ ` . These should be committed to
59
61
git repository, to enable Remote Components to load them in the clients.
60
62
63
+ ### Build base URL
64
+
65
+ The default base build URLs,
66
+ ` https://raw.githubusercontent.com/os2display/display-templates/develop/build/ `
67
+ and
68
+ ` https://raw.githubusercontent.com/os2display/display-templates/main/build/ ` ,
69
+ respectively, can be overridden via environment variables:
70
+
71
+ Override both with same value:
72
+
73
+ ``` sh
74
+ docker compose run --rm --env DEPLOYMENT_BUILD_BASE_URL=" http://$( docker compose port nginx 80) /build/" node yarn build
75
+ ```
76
+
77
+ Override "develop" base URL only:
78
+
79
+ ``` sh
80
+ docker compose run --rm --env DEPLOYMENT_BUILD_BASE_URL_DEVELOP=" http://$( docker compose port nginx 80) /build/" node yarn build
81
+ ```
82
+
83
+ Override "main" base URL only:
84
+
85
+ ``` sh
86
+ docker compose run --rm --env DEPLOYMENT_BUILD_BASE_URL_MAIN=" http://$( docker compose port nginx 80) /build/" node yarn build
87
+ ```
88
+
89
+ The default behavoir is equivalent to
90
+
91
+ ``` sh
92
+ docker compose run --rm \
93
+ --env DEPLOYMENT_BUILD_BASE_URL_DEVELOP=" https://raw.githubusercontent.com/os2display/display-templates/develop/build/" \
94
+ --env DEPLOYMENT_BUILD_BASE_URL_MAIN=" https://raw.githubusercontent.com/os2display/display-templates/main/build/" \
95
+ node yarn build
96
+ ```
97
+
61
98
### Linting
62
99
63
100
``` bash
64
- docker- compose run --rm node yarn check-coding-standards
101
+ docker compose run --rm node yarn check-coding-standards
65
102
```
66
103
67
104
``` bash
68
- docker- compose run --rm node yarn apply-coding-standards
105
+ docker compose run --rm node yarn apply-coding-standards
69
106
```
70
107
71
108
### Tests
0 commit comments