mirror of https://github.com/docker/docs.git
ci: add check for duplicate target paths / aliases
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
parent
886a27ae8d
commit
83adeefaec
|
@ -57,6 +57,7 @@ jobs:
|
|||
- unused-media
|
||||
- test-go-redirects
|
||||
- dockerfile-lint
|
||||
- path-warnings
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
|
|
12
Dockerfile
12
Dockerfile
|
@ -109,6 +109,18 @@ set -ex
|
|||
./scripts/test_unused_media.sh
|
||||
EOT
|
||||
|
||||
# path-warnings checks for duplicate target paths
|
||||
FROM build-base AS path-warnings
|
||||
RUN hugo --printPathWarnings > /path-warnings.txt
|
||||
RUN <<EOT
|
||||
DUPLICATE_TARGETS=$(grep "Duplicate target paths" /path-warnings.txt)
|
||||
if [ ! -z "$DUPLICATE_TARGETS" ]; then
|
||||
echo "$DUPLICATE_TARGETS"
|
||||
echo "You probably have a duplicate alias defined. Please check your aliases."
|
||||
exit 1
|
||||
fi
|
||||
EOT
|
||||
|
||||
# pagefind installs the Pagefind runtime
|
||||
FROM base AS pagefind
|
||||
ARG PAGEFIND_VERSION=1.1.0
|
||||
|
|
|
@ -32,7 +32,7 @@ target "release" {
|
|||
}
|
||||
|
||||
group "validate" {
|
||||
targets = ["lint", "test", "unused-media", "test-go-redirects", "dockerfile-lint"]
|
||||
targets = ["lint", "test", "unused-media", "test-go-redirects", "dockerfile-lint", "path-warnings"]
|
||||
}
|
||||
|
||||
target "test" {
|
||||
|
@ -63,6 +63,11 @@ target "dockerfile-lint" {
|
|||
call = "check"
|
||||
}
|
||||
|
||||
target "path-warnings" {
|
||||
target = "path-warnings"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
#
|
||||
# releaser targets are defined in _releaser/Dockerfile
|
||||
# and are used for AWS S3 deployment
|
||||
|
|
Loading…
Reference in New Issue