Skip to content

Commit 6ee8af6

Browse files
committed
Add dbdefs_to_js helper script to workaround consul-template issue
Since upgrading from consul-template v0.18.5 to v0.25.2 in b9ff252, the dbdefs_to_js command string is no longer parsed correctly. The DEBUG log level shows it getting cut off at the &&. I have no idea why this broke, as I can't find anything related in the changelog. Moving it to a separate script dumbs it down enough for the new version.
1 parent 5c91e50 commit 6ee8af6

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

docker/musicbrainz-website/consul-template-template-renderer.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
template {
22
source = "/home/musicbrainz/musicbrainz-server/lib/DBDefs.pm.ctmpl"
33
destination = "/home/musicbrainz/musicbrainz-server/lib/DBDefs.pm"
4-
command = "sudo -E -H -u musicbrainz sh -c 'cd ~/musicbrainz-server && carton exec -- ./script/dbdefs_to_js.pl'"
4+
command = "dbdefs_to_js.sh"
55
}
66

77
exec {

docker/musicbrainz-website/consul-template-website.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
template {
22
source = "/home/musicbrainz/musicbrainz-server/lib/DBDefs.pm.ctmpl"
33
destination = "/home/musicbrainz/musicbrainz-server/lib/DBDefs.pm"
4-
command = "sudo -E -H -u musicbrainz sh -c 'cd ~/musicbrainz-server && carton exec -- ./script/dbdefs_to_js.pl'"
4+
command = "dbdefs_to_js.sh"
55
}
66

77
exec {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
exec sudo -E -H -u musicbrainz sh -c 'cd ~/musicbrainz-server && carton exec -- ./script/dbdefs_to_js.pl'

docker/templates/Dockerfile.website.m4

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ RUN chmod 755 \
3030
COPY \
3131
docker/scripts/start_musicbrainz_server.sh \
3232
docker/scripts/start_template_renderer.sh \
33+
docker/musicbrainz-website/dbdefs_to_js.sh \
3334
/usr/local/bin/
35+
RUN chmod 755 \
36+
/usr/local/bin/start_musicbrainz_server.sh \
37+
/usr/local/bin/start_template_renderer.sh \
38+
/usr/local/bin/dbdefs_to_js.sh
3439

3540
copy_mb(`docker/templates/DBDefs.pm.ctmpl lib/')

0 commit comments

Comments
 (0)