@@ -91,3 +91,65 @@ manifest-push: docker-manifest-push
91
91
.PHONY : test
92
92
test :
93
93
./tests/start-ci.sh $(IMAGE ) $(DOCKER_TAG ) $(ARCH )
94
+
95
+
96
+ # -------------------------------------------------------------------------------------------------
97
+ # Internal Repository Targets
98
+ # -------------------------------------------------------------------------------------------------
99
+ .PHONY : _repo_fix
100
+ _repo_fix : __repo_fix_examples
101
+ _repo_fix : __repo_fix_doc
102
+ _repo_fix : __repo_fix_readme
103
+
104
+ # ##
105
+ # ## In case I've copied the examples/ from any repo, ensure to replace images with current
106
+ # ##
107
+ .PHONY : __repo_fix_examples
108
+ __repo_fix_examples :
109
+ find examples/ -type f -print0 | xargs -0 -n1 sh -c \
110
+ ' if grep "nginx-stable" "$${1}">/dev/null; then sed -i"" "s|devilbox/nginx-stable|$(IMAGE)|g" "$${1}";fi' --
111
+ find examples/ -type f -print0 | xargs -0 -n1 sh -c \
112
+ ' if grep "nginx-mainline" "$${1}">/dev/null; then sed -i"" "s|devilbox/nginx-mainline|$(IMAGE)|g" "$${1}";fi' --
113
+ find examples/ -type f -print0 | xargs -0 -n1 sh -c \
114
+ ' if grep "apache-2.2" "$${1}">/dev/null; then sed -i"" "s|devilbox/apache-2.2|$(IMAGE)|g" "$${1}";fi' --
115
+ find examples/ -type f -print0 | xargs -0 -n1 sh -c \
116
+ ' if grep "apache-2.4" "$${1}">/dev/null; then sed -i"" "s|devilbox/apache-2.4|$(IMAGE)|g" "$${1}";fi' --
117
+
118
+ # ##
119
+ # ## In case I've copied the doc/ from any repo, ensure to replace images with current
120
+ # ##
121
+ .PHONY : __repo_fix_doc
122
+ __repo_fix_doc :
123
+ find doc/ -name ' *.md' -type f -print0 | xargs -0 -n1 sh -c \
124
+ ' if grep "nginx-stable" "$${1}">/dev/null; then sed -i"" "s|devilbox/nginx-stable|$(IMAGE)|g" "$${1}";fi' --
125
+ find doc/ -name ' *.md' -type f -print0 | xargs -0 -n1 sh -c \
126
+ ' if grep "nginx-mainline" "$${1}">/dev/null; then sed -i"" "s|devilbox/nginx-mainline|$(IMAGE)|g" "$${1}";fi' --
127
+ find doc/ -name ' *.md' -type f -print0 | xargs -0 -n1 sh -c \
128
+ ' if grep "apache-2.2" "$${1}">/dev/null; then sed -i"" "s|devilbox/apache-2.2|$(IMAGE)|g" "$${1}";fi' --
129
+ find doc/ -name ' *.md' -type f -print0 | xargs -0 -n1 sh -c \
130
+ ' if grep "apache-2.4" "$${1}">/dev/null; then sed -i"" "s|devilbox/apache-2.4|$(IMAGE)|g" "$${1}";fi' --
131
+
132
+ # ##
133
+ # ## In case I've copied the doc/ from any repo, ensure to replace images with current
134
+ # ##
135
+ .PHONY : __repo_fix_readme
136
+ __repo_fix_readme :
137
+ sed -i' ' " s/^# Nginx stable$$ /# $( NAME) $( VERSION) /g" README.md
138
+ sed -i' ' " s/^# Nginx mainline$$ /# $( NAME) $( VERSION) /g" README.md
139
+ sed -i' ' " s/^# Apache 2.2$$ /# $( NAME) $( VERSION) /g" README.md
140
+ sed -i' ' " s/^# Apache 2.4$$ /# $( NAME) $( VERSION) /g" README.md
141
+ @#
142
+ sed -i' ' " s|docker--nginx--stable|$$ ( echo " docker/$(IMAGE ) " | awk -F'/' '{print $$ 1" -" $$ 3}' | awk -F'-' '{print $$ 1" --" $$ 2" --" $$ 3}' )|g" README.md
143
+ sed -i' ' " s|docker--nginx--mainline|$$ ( echo " docker/$(IMAGE ) " | awk -F'/' '{print $$ 1" -" $$ 3}' | awk -F'-' '{print $$ 1" --" $$ 2" --" $$ 3}' )|g" README.md
144
+ sed -i' ' " s|docker--apache--2.2|$$ ( echo " docker/$(IMAGE ) " | awk -F'/' '{print $$ 1" -" $$ 3}' | awk -F'-' '{print $$ 1" --" $$ 2" --" $$ 3}' )|g" README.md
145
+ sed -i' ' " s|docker--apache--2.4|$$ ( echo " docker/$(IMAGE ) " | awk -F'/' '{print $$ 1" -" $$ 3}' | awk -F'-' '{print $$ 1" --" $$ 2" --" $$ 3}' )|g" README.md
146
+ @#
147
+ sed -i' ' " s|docker-nginx-stable|$$ ( echo " docker-/$(IMAGE ) " | awk -F'/' '{print $$ 1$$ 3}')|g" README.md
148
+ sed -i' ' " s|docker-nginx-mainline|$$ ( echo " docker-/$(IMAGE ) " | awk -F'/' '{print $$ 1$$ 3}')|g" README.md
149
+ sed -i' ' " s|docker-apache-2.2|$$ ( echo " docker-/$(IMAGE ) " | awk -F'/' '{print $$ 1$$ 3}')|g" README.md
150
+ sed -i' ' " s|docker-apache-2.4|$$ ( echo " docker-/$(IMAGE ) " | awk -F'/' '{print $$ 1$$ 3}')|g" README.md
151
+ @#
152
+ sed -i' ' ' s|devilbox/nginx-stable|$(IMAGE)|g' README.md
153
+ sed -i' ' ' s|devilbox/nginx-mainline|$(IMAGE)|g' README.md
154
+ sed -i' ' ' s|devilbox/apache-2.2|$(IMAGE)|g' README.md
155
+ sed -i' ' ' s|devilbox/apache-2.4|$(IMAGE)|g' README.md
0 commit comments