diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 381061958618..c36b15dd1a5f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -37,3 +37,4 @@ /content/manuals/accounts/ @sarahsanders-docker +/hack @dvdksn diff --git a/.github/labeler.yml b/.github/labeler.yml index 9a51b7cca769..11cef0e77f6d 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index 43ecafd4e6be..aef5d06d3a90 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/Makefile b/Makefile index 6acc17763131..8a5b14de683a 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,3 @@ .PHONY: vendor vendor: ## vendor hugo modules - ./scripts/vendor.sh + ./hack/vendor diff --git a/content/guides/images/c-sharp.webp b/content/guides/images/c-sharp.webp deleted file mode 100644 index 7f373ae1df7b..000000000000 Binary files a/content/guides/images/c-sharp.webp and /dev/null differ diff --git a/content/guides/images/cpp.webp b/content/guides/images/cpp.webp deleted file mode 100644 index 0582cf588308..000000000000 Binary files a/content/guides/images/cpp.webp and /dev/null differ diff --git a/content/guides/images/golang.webp b/content/guides/images/golang.webp deleted file mode 100644 index 1c84f8a6b0bc..000000000000 Binary files a/content/guides/images/golang.webp and /dev/null differ diff --git a/content/guides/images/java.webp b/content/guides/images/java.webp deleted file mode 100644 index 6aeda48d6ef7..000000000000 Binary files a/content/guides/images/java.webp and /dev/null differ diff --git a/content/guides/images/nodejs.webp b/content/guides/images/nodejs.webp deleted file mode 100644 index 607b2b33968d..000000000000 Binary files a/content/guides/images/nodejs.webp and /dev/null differ diff --git a/content/guides/images/php-logo.webp b/content/guides/images/php-logo.webp deleted file mode 100644 index 91ca4c16b821..000000000000 Binary files a/content/guides/images/php-logo.webp and /dev/null differ diff --git a/content/guides/images/python.webp b/content/guides/images/python.webp deleted file mode 100644 index 0f2a3ab8fdbd..000000000000 Binary files a/content/guides/images/python.webp and /dev/null differ diff --git a/content/guides/images/ruby-on-rails.webp b/content/guides/images/ruby-on-rails.webp deleted file mode 100644 index c5c32ac545bd..000000000000 Binary files a/content/guides/images/ruby-on-rails.webp and /dev/null differ diff --git a/content/guides/images/rust-logo.webp b/content/guides/images/rust-logo.webp deleted file mode 100644 index b66d6ff4e1e0..000000000000 Binary files a/content/guides/images/rust-logo.webp and /dev/null differ diff --git a/content/manuals/admin/images/remove-owner.png b/content/manuals/admin/images/remove-owner.png deleted file mode 100644 index 8bda546ddb8e..000000000000 Binary files a/content/manuals/admin/images/remove-owner.png and /dev/null differ diff --git a/content/manuals/desktop/images/diagnose-support.png b/content/manuals/desktop/images/diagnose-support.png deleted file mode 100644 index 981eaa88809d..000000000000 Binary files a/content/manuals/desktop/images/diagnose-support.png and /dev/null differ diff --git a/content/manuals/desktop/images/troubleshoot.png b/content/manuals/desktop/images/troubleshoot.png deleted file mode 100644 index 7e24d46931ce..000000000000 Binary files a/content/manuals/desktop/images/troubleshoot.png and /dev/null differ diff --git a/content/manuals/desktop/setup/install/images/docker-app-in-apps.png b/content/manuals/desktop/setup/install/images/docker-app-in-apps.png deleted file mode 100644 index 6f1919185976..000000000000 Binary files a/content/manuals/desktop/setup/install/images/docker-app-in-apps.png and /dev/null differ diff --git a/content/manuals/docker-hub/images/index-tag.webp b/content/manuals/docker-hub/images/index-tag.webp deleted file mode 100644 index 078de74ae968..000000000000 Binary files a/content/manuals/docker-hub/images/index-tag.webp and /dev/null differ diff --git a/docker-bake.hcl b/docker-bake.hcl index 1e2a252e4a5b..dbbf1d568ccf 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -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 diff --git a/_releaser/Dockerfile b/hack/releaser/Dockerfile similarity index 100% rename from _releaser/Dockerfile rename to hack/releaser/Dockerfile diff --git a/_releaser/aws.go b/hack/releaser/aws.go similarity index 100% rename from _releaser/aws.go rename to hack/releaser/aws.go diff --git a/_releaser/cloudfront-lambda-redirects.js b/hack/releaser/cloudfront-lambda-redirects.js similarity index 100% rename from _releaser/cloudfront-lambda-redirects.js rename to hack/releaser/cloudfront-lambda-redirects.js diff --git a/_releaser/go.mod b/hack/releaser/go.mod similarity index 84% rename from _releaser/go.mod rename to hack/releaser/go.mod index 560760169ad8..d17c092280c4 100644 --- a/_releaser/go.mod +++ b/hack/releaser/go.mod @@ -1,4 +1,4 @@ -module github.com/docker/docs/_releaser +module github.com/docker/docs/hack/releaser go 1.22 diff --git a/_releaser/go.sum b/hack/releaser/go.sum similarity index 100% rename from _releaser/go.sum rename to hack/releaser/go.sum diff --git a/_releaser/main.go b/hack/releaser/main.go similarity index 100% rename from _releaser/main.go rename to hack/releaser/main.go diff --git a/_releaser/redirects-prefixes.json b/hack/releaser/redirects-prefixes.json similarity index 100% rename from _releaser/redirects-prefixes.json rename to hack/releaser/redirects-prefixes.json diff --git a/_releaser/s3-config.json b/hack/releaser/s3-config.json similarity index 100% rename from _releaser/s3-config.json rename to hack/releaser/s3-config.json diff --git a/scripts/test_go_redirects.sh b/hack/test/go_redirects similarity index 100% rename from scripts/test_go_redirects.sh rename to hack/test/go_redirects diff --git a/hack/test/unused_media b/hack/test/unused_media new file mode 100755 index 000000000000..56cb88796889 --- /dev/null +++ b/hack/test/unused_media @@ -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 diff --git a/scripts/vendor.sh b/hack/vendor similarity index 100% rename from scripts/vendor.sh rename to hack/vendor diff --git a/scripts/test_unused_media.sh b/scripts/test_unused_media.sh deleted file mode 100755 index 239b924fe38b..000000000000 --- a/scripts/test_unused_media.sh +++ /dev/null @@ -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 diff --git a/static/assets/images/green-check.svg b/static/assets/images/green-check.svg deleted file mode 100644 index b33d1fc52990..000000000000 --- a/static/assets/images/green-check.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - Round Check - Created with Sketch. - - - - - - - - - \ No newline at end of file