File tree Expand file tree Collapse file tree 4 files changed +40
-1
lines changed
Expand file tree Collapse file tree 4 files changed +40
-1
lines changed Original file line number Diff line number Diff line change 11<!doctype html>
2- {% assign absolute_target = page.target | absolute_url %}
2+ {% assign absolute_target = page.target | replace: '$$LATEST_RELEASE$$', site.data.kroxylicious.latestRelease | absolute_url %}
33< html lang ="en ">
44< head >
55 < meta charset ="utf-8 ">
Original file line number Diff line number Diff line change @@ -34,3 +34,4 @@ BUILD_COMMAND='eval "$(rbenv init -)" && cp -r /css/_sass/bootstrap /site/_sass/
3434RUN_ARGS+=(bash -c " ${BUILD_COMMAND} " )
3535echo " ${RUN_ARGS[@]} "
3636${CONTAINER_ENGINE} run " ${RUN_ARGS[@]} "
37+ ./test.sh
Original file line number Diff line number Diff line change 1+ ---
2+ layout : redirect
3+ target : " /documentation/$$LATEST_RELEASE$$/html/proxy-quick-start/"
4+ delay : 1
5+ ---
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Checks the output of build.sh (which is the production build deployed to pages)
3+ set -euo pipefail
4+
5+ LATEST_RELEASE=$( grep " latestRelease:" _data/kroxylicious.yml | awk ' {print $2}' )
6+
7+ LATEST_RELEASE_QUICKSTART=" _site/documentation/${LATEST_RELEASE} /html/proxy-quick-start/index.html"
8+ PERMANENT_QUICKSTART_REDIRECT=" _site/go.html"
9+ EXPECTED_REDIRECT_STRING=" <meta http-equiv=\" refresh\" content=\" 1; url=https://kroxylicious.io/documentation/${LATEST_RELEASE} /html/proxy-quick-start/\" >"
10+
11+ check_file_exists () {
12+ local file_path=" $1 "
13+ local file_description=" $2 "
14+ if [ -f " ${file_path} " ]; then
15+ echo " SUCCESS: ${file_description} file found at ${file_path} "
16+ else
17+ echo " ERROR: ${file_description} file not found at ${file_path} " >&2
18+ exit 1
19+ fi
20+ }
21+
22+ echo " Expect /go to HTML redirect to the latest quickstart"
23+ check_file_exists " ${LATEST_RELEASE_QUICKSTART} " " Latest release quickstart"
24+ check_file_exists " ${PERMANENT_QUICKSTART_REDIRECT} " " Permanent quickstart redirect"
25+
26+ if grep -qF " ${EXPECTED_REDIRECT_STRING} " " ${PERMANENT_QUICKSTART_REDIRECT} " ; then
27+ echo " SUCCESS: Expected redirect string found in ${PERMANENT_QUICKSTART_REDIRECT} "
28+ else
29+ echo " ERROR: Expected redirect string '${EXPECTED_REDIRECT_STRING} ' not found in ${PERMANENT_QUICKSTART_REDIRECT} "
30+ exit 1
31+ fi
32+ echo " All checks succeeded!"
33+ exit 0
You can’t perform that action at this time.
0 commit comments