File tree 2 files changed +15
-7
lines changed
2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,10 @@ mkdir "${K8S_VOLUME_PATH}/content"
20
20
cp -a /etc/nginx/http.d " ${K8S_VOLUME_PATH} /config"
21
21
cp -a " ${NGINX_SERVER_ROOT} " " ${K8S_VOLUME_PATH} /content"
22
22
23
- export OLD_NGINX_SERVER_ROOT=" ${NGINX_SERVER_ROOT} "
24
- export NGINX_SERVER_ROOT=${K8S_VOLUME_PATH} /content/html
25
- /templater.sh
23
+ (
24
+ export OLD_NGINX_SERVER_ROOT=" ${NGINX_SERVER_ROOT} "
25
+ export NGINX_SERVER_ROOT=${K8S_VOLUME_PATH} /content/html
26
+ /templater.sh
27
+ )
26
28
27
29
render_templates " ${K8S_VOLUME_PATH} /config/http.d/default.conf.tmpl"
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ teardown_file() {
16
16
docker volume rm -f " ${docker_volume} " || true
17
17
}
18
18
19
- @test " k8s-init" {
19
+ @test " k8s-init check copy and render " {
20
20
# Fix volume permissions to match K8s behaviour
21
21
docker run --rm -v " ${docker_volume} :/volume" busybox install -d -o root -g 2000 -m 2775 /volume
22
22
@@ -30,10 +30,16 @@ teardown_file() {
30
30
assert_line ' /volume/config/http.d/default.conf'
31
31
assert_line ' /volume/content/html/env-config.js'
32
32
assert_line ' /volume/content/html/env-config2.js'
33
+ }
34
+
35
+ @test " k8s-init check nginx default.conf" {
36
+ # Don't need to redo the permissions and k8s-init since no parallelize is set in this file
33
37
34
- # assert_output --regexp '/volume/config/http\.d/default\.conf[^.]'
35
- # assert_output --regexp '/volume/content/html/env-config\.js[^.]'
36
- # assert_output --regexp '/volume/content/html/env-config2\.js[^.]'
38
+ # Print the content of nginx default.conf
39
+ run docker run --rm -v " ${docker_volume} :/volume" busybox cat /volume/config/http.d/default.conf
40
+
41
+ # diag "${output}"
42
+ assert_line -p ' root /var/www/html;'
37
43
}
38
44
39
45
@test " k8s-nginx" {
You can’t perform that action at this time.
0 commit comments