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:
authorAchilleas Pipinellis <axil@gitlab.com>2021-03-01 15:40:19 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2021-03-19 13:05:37 +0300
commitaffb046528285049509a38a23af0dbcc6e44b355 (patch)
treeccf92df1898c77c1059209c22ed0dbd9604e5edc /scripts
parentb912f3542568ec70a0e762cdb9d15de2349ab3b7 (diff)
Make readme symlinks work on stable branches
https://gitlab.com/gitlab-org/gitlab-docs/-/merge_requests/1499 didn't account for the stable branches, and we now have redirect loops. This commit fixes that by using the 'symlink_readmes' raketask for the branches that have it and the old method for old branches.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check_symlinks.sh7
-rwxr-xr-xscripts/normalize-links.sh10
2 files changed, 15 insertions, 2 deletions
diff --git a/scripts/check_symlinks.sh b/scripts/check_symlinks.sh
new file mode 100755
index 00000000..2f76892b
--- /dev/null
+++ b/scripts/check_symlinks.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+bundle exec rake -T | grep symlink_readmes
+if [ $? -eq 0 ]
+then
+ bundle exec rake symlink_readmes
+fi
diff --git a/scripts/normalize-links.sh b/scripts/normalize-links.sh
index 502b6d2d..0e35e022 100755
--- a/scripts/normalize-links.sh
+++ b/scripts/normalize-links.sh
@@ -85,9 +85,15 @@ find ${TARGET}/$VER -type f -name 'sitemap.xml' -print0 | xargs -0 sed -i 's#doc
## In order to have clean URLs, we symlink README.html to index.html.
## That way, visiting https://docs.gitlab.com/ee/ would be the same as
## visiting https://docs.gitlab.com/ee/{README.html,index.html}
+## For 13.9 and later, there's a raketask that is run instead of the
+## command below. If the raketask is present, skip the command.
##
-echo "Symlink all README.html to index.html"
-for i in `find ${TARGET}/${VER} -name README.html`; do ln -sf README.html $(dirname $i)/index.html; done
+bundle exec rake -T | grep symlink_readmes
+if [ $? -eq 1 ]
+then
+ echo "Symlink all README.html to index.html"
+ for i in `find ${TARGET}/${VER} -name README.html`; do ln -sf README.html $(dirname $i)/index.html; done
+fi
##
## Don't deploy the CE docs since they are identical to the EE ones.