Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Amirault <mamirault@gitlab.com>2020-12-01 09:31:40 +0300
committerEvan Read <eread@gitlab.com>2020-12-01 09:31:40 +0300
commit3a2b103758bd3cdb060f424674a46be38194c816 (patch)
treebcce954094897c690110486cf926a6dbec6ab3c1
parent6efa4fb798ce9be931e8fcd6d8d9c9727b711082 (diff)
Create job to test for unlinked images
-rw-r--r--.gitlab-ci.yml23
-rwxr-xr-xtasks/unlinked-images.sh3
2 files changed, 26 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 326f7861..d7591b0d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -293,6 +293,29 @@ test_EOL_whitespace:
- markdownlint --version
- markdownlint -c .markdownlint.json **/*.md
+test_unlinked_images:
+ extends:
+ - .rules_chores
+ stage: test
+ image: registry.gitlab.com/gitlab-org/gitlab-docs/lint:latest
+ needs: []
+ before_script: []
+ dependencies: []
+ script:
+ - bundle exec rake setup_git default
+ - cp tasks/unlinked-images.sh tmp/ee/unlinked-images.sh
+ - cp tasks/unlinked-images.sh tmp/charts/unlinked-images.sh
+ - cp tasks/unlinked-images.sh tmp/omnibus/unlinked-images.sh
+ - cp tasks/unlinked-images.sh tmp/runner/unlinked-images.sh
+ - cd tmp/omnibus
+ - ./unlinked-images.sh doc
+ - cd ../charts
+ - ./unlinked-images.sh doc
+ - cd ../runner
+ - ./unlinked-images.sh docs
+ - cd ../ee
+ - ./unlinked-images.sh doc
+
###############################################
# Review Apps #
###############################################
diff --git a/tasks/unlinked-images.sh b/tasks/unlinked-images.sh
new file mode 100755
index 00000000..91e5710f
--- /dev/null
+++ b/tasks/unlinked-images.sh
@@ -0,0 +1,3 @@
+for FILE in $(git ls-files ./$1/*.png ./$1/*.gif ./$1/*.jpg); do
+ git grep $(basename "$FILE") > /dev/null || echo "Unlinked file: $FILE"
+done