Skip to content

Commit

Permalink
Update go-replace and implement --path support
Browse files Browse the repository at this point in the history
  • Loading branch information
mblaschke committed Apr 4, 2017
1 parent 442aa34 commit 2c86d0c
Show file tree
Hide file tree
Showing 173 changed files with 3,416 additions and 527 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace "<WEB_NO_CACHE_PATTERN>" -r "$WEB_NO_CACHE_PATTERN" -- > /dev/null
go-replace \
-s "<WEB_NO_CACHE_PATTERN>" \
-r "$WEB_NO_CACHE_PATTERN" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace "<WEB_NO_CACHE_PATTERN>" -r "$WEB_NO_CACHE_PATTERN" -- > /dev/null
go-replace \
-s "<WEB_NO_CACHE_PATTERN>" \
-r "$WEB_NO_CACHE_PATTERN" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace "<WEB_NO_CACHE_PATTERN>" -r "$WEB_NO_CACHE_PATTERN" -- > /dev/null
go-replace \
-s "<WEB_NO_CACHE_PATTERN>" \
-r "$WEB_NO_CACHE_PATTERN" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace "<WEB_NO_CACHE_PATTERN>" -r "$WEB_NO_CACHE_PATTERN" -- > /dev/null
go-replace \
-s "<WEB_NO_CACHE_PATTERN>" \
-r "$WEB_NO_CACHE_PATTERN" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace "<WEB_NO_CACHE_PATTERN>" -r "$WEB_NO_CACHE_PATTERN" -- > /dev/null
go-replace \
-s "<WEB_NO_CACHE_PATTERN>" \
-r "$WEB_NO_CACHE_PATTERN" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace "<WEB_NO_CACHE_PATTERN>" -r "$WEB_NO_CACHE_PATTERN" -- > /dev/null
go-replace \
-s "<WEB_NO_CACHE_PATTERN>" \
-r "$WEB_NO_CACHE_PATTERN" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace "<WEB_NO_CACHE_PATTERN>" -r "$WEB_NO_CACHE_PATTERN" -- > /dev/null
go-replace \
-s "<WEB_NO_CACHE_PATTERN>" \
-r "$WEB_NO_CACHE_PATTERN" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace "<WEB_NO_CACHE_PATTERN>" -r "$WEB_NO_CACHE_PATTERN" -- > /dev/null
go-replace \
-s "<WEB_NO_CACHE_PATTERN>" \
-r "$WEB_NO_CACHE_PATTERN" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace "<WEB_NO_CACHE_PATTERN>" -r "$WEB_NO_CACHE_PATTERN" -- > /dev/null
go-replace \
-s "<WEB_NO_CACHE_PATTERN>" \
-r "$WEB_NO_CACHE_PATTERN" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace "<WEB_NO_CACHE_PATTERN>" -r "$WEB_NO_CACHE_PATTERN" -- > /dev/null
go-replace \
-s "<WEB_NO_CACHE_PATTERN>" \
-r "$WEB_NO_CACHE_PATTERN" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace "<WEB_NO_CACHE_PATTERN>" -r "$WEB_NO_CACHE_PATTERN" -- > /dev/null
go-replace \
-s "<WEB_NO_CACHE_PATTERN>" \
-r "$WEB_NO_CACHE_PATTERN" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty
38 changes: 33 additions & 5 deletions docker/apache/alpine-3/conf/bin/service.d/httpd.d/10-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,42 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then
fi

# Replace markers
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<DOCUMENT_INDEX>" -r "$WEB_DOCUMENT_INDEX"
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<DOCUMENT_ROOT>" -r "$WEB_DOCUMENT_ROOT"
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<ALIAS_DOMAIN>" -r "$WEB_ALIAS_DOMAIN"
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<SERVERNAME>" -r "$HOSTNAME"
go-replace \
-s "<DOCUMENT_INDEX>" \
-r "$WEB_DOCUMENT_INDEX" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

go-replace \
-s "<DOCUMENT_ROOT>" \
-r "$WEB_DOCUMENT_ROOT" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

go-replace \
-s "<ALIAS_DOMAIN>" \
-r "$WEB_ALIAS_DOMAIN" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

go-replace \
-s "<SERVERNAME>" \
-r "$HOSTNAME" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then
## WEB_PHP_SOCKET is set
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<PHP_SOCKET>" -r "$WEB_PHP_SOCKET"
go-replace \
-s "<PHP_SOCKET>" \
-r "$WEB_PHP_SOCKET" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty
else
## WEB_PHP_SOCKET is not set, remove PHP files
rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf
Expand Down
38 changes: 33 additions & 5 deletions docker/apache/centos-7/conf/bin/service.d/httpd.d/10-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,42 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then
fi

# Replace markers
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<DOCUMENT_INDEX>" -r "$WEB_DOCUMENT_INDEX"
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<DOCUMENT_ROOT>" -r "$WEB_DOCUMENT_ROOT"
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<ALIAS_DOMAIN>" -r "$WEB_ALIAS_DOMAIN"
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<SERVERNAME>" -r "$HOSTNAME"
go-replace \
-s "<DOCUMENT_INDEX>" \
-r "$WEB_DOCUMENT_INDEX" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

go-replace \
-s "<DOCUMENT_ROOT>" \
-r "$WEB_DOCUMENT_ROOT" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

go-replace \
-s "<ALIAS_DOMAIN>" \
-r "$WEB_ALIAS_DOMAIN" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

go-replace \
-s "<SERVERNAME>" \
-r "$HOSTNAME" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then
## WEB_PHP_SOCKET is set
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<PHP_SOCKET>" -r "$WEB_PHP_SOCKET"
go-replace \
-s "<PHP_SOCKET>" \
-r "$WEB_PHP_SOCKET" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty
else
## WEB_PHP_SOCKET is not set, remove PHP files
rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf
Expand Down
38 changes: 33 additions & 5 deletions docker/apache/debian-7/conf/bin/service.d/httpd.d/10-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,42 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then
fi

# Replace markers
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<DOCUMENT_INDEX>" -r "$WEB_DOCUMENT_INDEX"
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<DOCUMENT_ROOT>" -r "$WEB_DOCUMENT_ROOT"
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<ALIAS_DOMAIN>" -r "$WEB_ALIAS_DOMAIN"
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<SERVERNAME>" -r "$HOSTNAME"
go-replace \
-s "<DOCUMENT_INDEX>" \
-r "$WEB_DOCUMENT_INDEX" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

go-replace \
-s "<DOCUMENT_ROOT>" \
-r "$WEB_DOCUMENT_ROOT" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

go-replace \
-s "<ALIAS_DOMAIN>" \
-r "$WEB_ALIAS_DOMAIN" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

go-replace \
-s "<SERVERNAME>" \
-r "$HOSTNAME" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then
## WEB_PHP_SOCKET is set
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<PHP_SOCKET>" -r "$WEB_PHP_SOCKET"
go-replace \
-s "<PHP_SOCKET>" \
-r "$WEB_PHP_SOCKET" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty
else
## WEB_PHP_SOCKET is not set, remove PHP files
rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf
Expand Down
38 changes: 33 additions & 5 deletions docker/apache/debian-8/conf/bin/service.d/httpd.d/10-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,42 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then
fi

# Replace markers
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<DOCUMENT_INDEX>" -r "$WEB_DOCUMENT_INDEX"
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<DOCUMENT_ROOT>" -r "$WEB_DOCUMENT_ROOT"
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<ALIAS_DOMAIN>" -r "$WEB_ALIAS_DOMAIN"
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<SERVERNAME>" -r "$HOSTNAME"
go-replace \
-s "<DOCUMENT_INDEX>" \
-r "$WEB_DOCUMENT_INDEX" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

go-replace \
-s "<DOCUMENT_ROOT>" \
-r "$WEB_DOCUMENT_ROOT" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

go-replace \
-s "<ALIAS_DOMAIN>" \
-r "$WEB_ALIAS_DOMAIN" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

go-replace \
-s "<SERVERNAME>" \
-r "$HOSTNAME" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then
## WEB_PHP_SOCKET is set
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<PHP_SOCKET>" -r "$WEB_PHP_SOCKET"
go-replace \
-s "<PHP_SOCKET>" \
-r "$WEB_PHP_SOCKET" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty
else
## WEB_PHP_SOCKET is not set, remove PHP files
rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf
Expand Down
38 changes: 33 additions & 5 deletions docker/apache/debian-9/conf/bin/service.d/httpd.d/10-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,42 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then
fi

# Replace markers
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<DOCUMENT_INDEX>" -r "$WEB_DOCUMENT_INDEX"
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<DOCUMENT_ROOT>" -r "$WEB_DOCUMENT_ROOT"
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<ALIAS_DOMAIN>" -r "$WEB_ALIAS_DOMAIN"
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<SERVERNAME>" -r "$HOSTNAME"
go-replace \
-s "<DOCUMENT_INDEX>" \
-r "$WEB_DOCUMENT_INDEX" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

go-replace \
-s "<DOCUMENT_ROOT>" \
-r "$WEB_DOCUMENT_ROOT" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

go-replace \
-s "<ALIAS_DOMAIN>" \
-r "$WEB_ALIAS_DOMAIN" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

go-replace \
-s "<SERVERNAME>" \
-r "$HOSTNAME" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then
## WEB_PHP_SOCKET is set
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<PHP_SOCKET>" -r "$WEB_PHP_SOCKET"
go-replace \
-s "<PHP_SOCKET>" \
-r "$WEB_PHP_SOCKET" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty
else
## WEB_PHP_SOCKET is not set, remove PHP files
rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf
Expand Down
38 changes: 33 additions & 5 deletions docker/apache/ubuntu-12.04/conf/bin/service.d/httpd.d/10-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,42 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then
fi

# Replace markers
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<DOCUMENT_INDEX>" -r "$WEB_DOCUMENT_INDEX"
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<DOCUMENT_ROOT>" -r "$WEB_DOCUMENT_ROOT"
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<ALIAS_DOMAIN>" -r "$WEB_ALIAS_DOMAIN"
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<SERVERNAME>" -r "$HOSTNAME"
go-replace \
-s "<DOCUMENT_INDEX>" \
-r "$WEB_DOCUMENT_INDEX" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

go-replace \
-s "<DOCUMENT_ROOT>" \
-r "$WEB_DOCUMENT_ROOT" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

go-replace \
-s "<ALIAS_DOMAIN>" \
-r "$WEB_ALIAS_DOMAIN" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

go-replace \
-s "<SERVERNAME>" \
-r "$HOSTNAME" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty

if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then
## WEB_PHP_SOCKET is set
find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r go-replace -s "<PHP_SOCKET>" -r "$WEB_PHP_SOCKET"
go-replace \
-s "<PHP_SOCKET>" \
-r "$WEB_PHP_SOCKET" \
--path=/opt/docker/etc/httpd/ \
--path-pattern='*.conf' \
--ignore-empty
else
## WEB_PHP_SOCKET is not set, remove PHP files
rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf
Expand Down

0 comments on commit 2c86d0c

Please sign in to comment.