mirror of
https://github.com/docker/docs.git
synced 2026-03-27 06:18:55 +07:00
ci: add check for duplicate target paths / aliases
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
1
.github/workflows/build.yml
vendored
1
.github/workflows/build.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user