Merge pull request #21439 from dvdksn/test-refactor
chore: refactor / fix tests
|
@ -37,3 +37,4 @@
|
|||
|
||||
/content/manuals/accounts/ @sarahsanders-docker
|
||||
|
||||
/hack @dvdksn
|
||||
|
|
|
@ -2,7 +2,7 @@ area/release:
|
|||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- .github/**
|
||||
- _releaser/**
|
||||
- hack/releaser/**
|
||||
- netlify.toml
|
||||
|
||||
area/config:
|
||||
|
@ -14,6 +14,7 @@ area/config:
|
|||
- docker-bake.hcl
|
||||
- hugo.yaml
|
||||
- pagefind.yml
|
||||
- hack/vendor
|
||||
|
||||
area/contrib:
|
||||
- changed-files:
|
||||
|
@ -28,7 +29,7 @@ area/tests:
|
|||
- .markdownlint.json
|
||||
- .vale.ini
|
||||
- _vale/**
|
||||
- scripts/test_*
|
||||
- hack/test/*
|
||||
|
||||
area/build:
|
||||
- changed-files:
|
||||
|
@ -183,3 +184,4 @@ dependencies:
|
|||
- go.sum
|
||||
- package*.json
|
||||
- _vendor/**
|
||||
- hack/vendor
|
||||
|
|
|
@ -110,10 +110,7 @@ RUN htmltest
|
|||
FROM alpine:${ALPINE_VERSION} AS unused-media
|
||||
RUN apk add --no-cache fd ripgrep
|
||||
WORKDIR /test
|
||||
RUN --mount=type=bind,target=. <<"EOT"
|
||||
set -ex
|
||||
./scripts/test_unused_media.sh
|
||||
EOT
|
||||
RUN --mount=type=bind,target=. ./hack/test/unused_media
|
||||
|
||||
# path-warnings checks for duplicate target paths
|
||||
FROM build-base AS path-warnings
|
||||
|
@ -145,7 +142,7 @@ RUN apk add yq
|
|||
COPY --from=build /project/public ./public
|
||||
RUN --mount=type=bind,target=. <<"EOT"
|
||||
set -ex
|
||||
./scripts/test_go_redirects.sh
|
||||
./hack/test/go_redirects
|
||||
EOT
|
||||
|
||||
# release is an empty scratch image with only compiled assets
|
||||
|
|
2
Makefile
|
@ -1,3 +1,3 @@
|
|||
.PHONY: vendor
|
||||
vendor: ## vendor hugo modules
|
||||
./scripts/vendor.sh
|
||||
./hack/vendor
|
||||
|
|
Двоичные данные
content/guides/images/c-sharp.webp
До Ширина: | Высота: | Размер: 12 KiB |
Двоичные данные
content/guides/images/cpp.webp
До Ширина: | Высота: | Размер: 46 KiB |
Двоичные данные
content/guides/images/golang.webp
До Ширина: | Высота: | Размер: 16 KiB |
Двоичные данные
content/guides/images/java.webp
До Ширина: | Высота: | Размер: 4.5 KiB |
Двоичные данные
content/guides/images/nodejs.webp
До Ширина: | Высота: | Размер: 5.5 KiB |
Двоичные данные
content/guides/images/php-logo.webp
До Ширина: | Высота: | Размер: 14 KiB |
Двоичные данные
content/guides/images/python.webp
До Ширина: | Высота: | Размер: 3.2 KiB |
Двоичные данные
content/guides/images/ruby-on-rails.webp
До Ширина: | Высота: | Размер: 28 KiB |
Двоичные данные
content/guides/images/rust-logo.webp
До Ширина: | Высота: | Размер: 8.5 KiB |
Двоичные данные
content/manuals/admin/images/remove-owner.png
До Ширина: | Высота: | Размер: 17 KiB |
Двоичные данные
content/manuals/desktop/images/diagnose-support.png
До Ширина: | Высота: | Размер: 63 KiB |
Двоичные данные
content/manuals/desktop/images/troubleshoot.png
До Ширина: | Высота: | Размер: 41 KiB |
До Ширина: | Высота: | Размер: 89 KiB |
Двоичные данные
content/manuals/docker-hub/images/index-tag.webp
До Ширина: | Высота: | Размер: 42 KiB |
|
@ -73,12 +73,12 @@ target "path-warnings" {
|
|||
}
|
||||
|
||||
#
|
||||
# releaser targets are defined in _releaser/Dockerfile
|
||||
# releaser targets are defined in hack/releaser/Dockerfile
|
||||
# and are used for AWS S3 deployment
|
||||
#
|
||||
|
||||
target "releaser-build" {
|
||||
context = "_releaser"
|
||||
context = "hack/releaser"
|
||||
target = "releaser"
|
||||
output = ["type=cacheonly"]
|
||||
provenance = false
|
||||
|
@ -119,7 +119,7 @@ target "_common-aws" {
|
|||
|
||||
target "aws-s3-update-config" {
|
||||
inherits = ["_common-aws"]
|
||||
context = "_releaser"
|
||||
context = "hack/releaser"
|
||||
target = "aws-s3-update-config"
|
||||
no-cache-filter = ["aws-update-config"]
|
||||
output = ["type=cacheonly"]
|
||||
|
@ -127,7 +127,7 @@ target "aws-s3-update-config" {
|
|||
|
||||
target "aws-lambda-invoke" {
|
||||
inherits = ["_common-aws"]
|
||||
context = "_releaser"
|
||||
context = "hack/releaser"
|
||||
target = "aws-lambda-invoke"
|
||||
no-cache-filter = ["aws-lambda-invoke"]
|
||||
output = ["type=cacheonly"]
|
||||
|
@ -135,7 +135,7 @@ target "aws-lambda-invoke" {
|
|||
|
||||
target "aws-cloudfront-update" {
|
||||
inherits = ["_common-aws"]
|
||||
context = "_releaser"
|
||||
context = "hack/releaser"
|
||||
target = "aws-cloudfront-update"
|
||||
contexts = {
|
||||
sitedir = DOCS_SITE_DIR
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module github.com/docker/docs/_releaser
|
||||
module github.com/docker/docs/hack/releaser
|
||||
|
||||
go 1.22
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
echo "checking for unused media files..."
|
||||
FORMATS="svg png webp mp4 jpg jpeg"
|
||||
DIRECTORIES="content static"
|
||||
|
||||
FORMAT_FLAGS=""
|
||||
for format in $FORMATS; do
|
||||
FORMAT_FLAGS="$FORMAT_FLAGS -e $format"
|
||||
done
|
||||
|
||||
echo "Searching for media with formats: $FORMATS"
|
||||
echo "Searching in directories: $DIRECTORIES"
|
||||
|
||||
MEDIA=$(fd . $FORMAT_FLAGS $DIRECTORIES)
|
||||
|
||||
UNUSED_COUNT=0
|
||||
|
||||
for file in $MEDIA; do
|
||||
rg -q "$(basename $file)" .
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "$file"
|
||||
UNUSED_COUNT=$((UNUSED_COUNT + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $UNUSED_COUNT -eq 0 ]; then
|
||||
echo "No unused media files."
|
||||
exit 0
|
||||
else
|
||||
echo "$UNUSED_COUNT unused media files found. Please remove them."
|
||||
exit 1
|
||||
fi
|
|
@ -1,23 +0,0 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
# Find all media files {svg,png,webp,mp4,jpg,jpeg} in {content,static}
|
||||
MEDIA=$(fd . -e "svg" -e "png" -e "webp" -e "mp4" -e "jpg" -e "jpeg" ./content ./static)
|
||||
TEMPFILE=$(mktemp)
|
||||
|
||||
for file in $MEDIA; do
|
||||
rg -q "$(basename $file)"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "$file" >> "$TEMPFILE"
|
||||
fi
|
||||
done
|
||||
|
||||
UNUSED_FILES=$(< $TEMPFILE)
|
||||
rm $TEMPFILE
|
||||
|
||||
if [ -z "$UNUSED_FILES" ]; then
|
||||
exit 0
|
||||
else
|
||||
echo "$(echo "$UNUSED_FILES" | wc -l) unused media files. Please remove them."
|
||||
printf "%s\n" ${UNUSED_FILES[@]}
|
||||
exit 1
|
||||
fi
|
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 42 (36781) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Round Check</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="System" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Round-Check">
|
||||
<polygon id="Icon-Bounds" points="0 0 24 0 24 24 0 24"></polygon>
|
||||
<circle id="Oval" fill="#00CBCA" cx="12" cy="12" r="11"></circle>
|
||||
<polygon id="Combined-Shape" fill="#FBFBFC" points="7.04599508 11 5 13.1940611 10.1213203 17.9711941 18.9711941 9.12132034 16.8498737 7 10.0492724 13.8006014"></polygon>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
До Ширина: | Высота: | Размер: 846 B |