You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by zr...@apache.org on 2021/12/15 17:11:16 UTC

[camel-website] branch main updated (14fc883 -> 84d9574)

This is an automated email from the ASF dual-hosted git repository.

zregvart pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-website.git.


    from 14fc883  fix: skip redirect checks
     new 64bc5da  chore: additional check that website is up
     new 197b77e  chore: fetch .htaccess from git
     new 84d9574  chore: reinstate redirect checks

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 package.json      |  2 +-
 tests/redirect.sh | 36 ++++++++++++++++++++++++++++++------
 2 files changed, 31 insertions(+), 7 deletions(-)

[camel-website] 03/03: chore: reinstate redirect checks

Posted by zr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zregvart pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-website.git

commit 84d9574726ab3b79985b94ab0ddb5a95afd4131c
Author: Zoran Regvart <zo...@regvart.com>
AuthorDate: Wed Dec 15 13:03:53 2021 +0100

    chore: reinstate redirect checks
---
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package.json b/package.json
index bf4a8a8..3492ee0 100644
--- a/package.json
+++ b/package.json
@@ -13,7 +13,7 @@
     "check:html": "html-validate public",
     "check:links": "deadlinks-linux public",
     "check:redirects": "tests/redirect.sh -s",
-    "checks": "run-s check:links check:html",
+    "checks": "run-s check:links check:html check:redirects",
     "clean": "gulp clean",
     "check:dependencies": "run-p check:cache check:dedupe",
     "check:cache": "yarn workspaces foreach install --immutable --immutable-cache --check-cache",

[camel-website] 02/03: chore: fetch .htaccess from git

Posted by zr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zregvart pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-website.git

commit 197b77ecb1a9b20a106afcab16c1b60dffaa3850
Author: Zoran Regvart <zo...@regvart.com>
AuthorDate: Wed Dec 15 11:56:31 2021 +0100

    chore: fetch .htaccess from git
    
    If the website wasn't built we can still run the redirect checks by
    loading the live `.htaccess` file from the `asf-site` branch in git.
    This way we can run the redirect checks independent of the build if we
    need to.
---
 tests/redirect.sh | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/tests/redirect.sh b/tests/redirect.sh
index 96752ea..a3098c5 100755
--- a/tests/redirect.sh
+++ b/tests/redirect.sh
@@ -130,12 +130,18 @@ function test {
   fi
 }
 
+HTACCESS_FILE="$GIT_ROOT/documentation/.htaccess"
+if [ ! -f "$HTACCESS_FILE" ]; then
+  echo "No $HTACCESS_FILE found, using last published version. If you have made changes to the Antora playbook make sure to build the site first to test those."
+  $CURL_CMD -s -o "$HTACCESS_FILE" 'https://gitbox.apache.org/repos/asf?p=camel-website.git;a=blob_plain;f=.htaccess;hb=refs/heads/asf-site'
+fi
+
 # determine current _latest_ versions
-COMPONENTS_VERSION="$(grep 'components/latest' "$GIT_ROOT/documentation/.htaccess" | grep -Z -o '[^/]*$')"
-CAMEL_K_VERSION="$(grep 'camel-k/latest' "$GIT_ROOT/documentation/.htaccess" | grep -Z -o '[^/]*$')"
-CAMEL_KAFKA_CONNECTOR_VERSION="$(grep 'camel-kafka-connector/latest' "$GIT_ROOT/documentation/.htaccess" | grep -Z -o '[^/]*$')"
-CAMEL_QUARKUS_VERSION="$(grep 'camel-quarkus/latest' "$GIT_ROOT/documentation/.htaccess" | grep -Z -o '[^/]*$')"
-CAMEL_KAMELETS_VERSION="$(grep 'camel-kamelets/latest' "$GIT_ROOT/documentation/.htaccess" | grep -Z -o '[^/]*$')"
+COMPONENTS_VERSION="$(grep '^Redirect 302 /components/latest' "$HTACCESS_FILE" | grep -Z -o '[^/]*$')"
+CAMEL_K_VERSION="$(grep '^Redirect 302 /camel-k/latest' "$HTACCESS_FILE" | grep -Z -o '[^/]*$')"
+CAMEL_KAFKA_CONNECTOR_VERSION="$(grep '^Redirect 302 /camel-kafka-connector/latest' "$HTACCESS_FILE" | grep -Z -o '[^/]*$')"
+CAMEL_QUARKUS_VERSION="$(grep '^Redirect 302 /camel-quarkus/latest' "$HTACCESS_FILE" | grep -Z -o '[^/]*$')"
+CAMEL_KAMELETS_VERSION="$(grep '^Redirect 302 /camel-kamelets/latest' "$HTACCESS_FILE" | grep -Z -o '[^/]*$')"
 
 #
 # TESTS

[camel-website] 01/03: chore: additional check that website is up

Posted by zr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zregvart pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-website.git

commit 64bc5da0a8fa211aeb39eee49e98d38ec736994f
Author: Zoran Regvart <zo...@regvart.com>
AuthorDate: Wed Dec 15 14:31:50 2021 +0100

    chore: additional check that website is up
    
    When running the web server in a container for the redirect tests there
    could be some network issues reaching it. This adds detection of that
    situation and switches to using curl from inside of the web server
    container.
    
    This issue has occurred once on ASF Jenkins in build 622[1],
    unfortunately without details allowing us to troubleshot this issue.
    
    [1] https://ci-builds.apache.org/job/Camel/job/Camel.website/job/main/622/
---
 tests/redirect.sh | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/tests/redirect.sh b/tests/redirect.sh
index a05ebad..96752ea 100755
--- a/tests/redirect.sh
+++ b/tests/redirect.sh
@@ -84,6 +84,24 @@ if [ "$SERVE" == 1 ]; then
   fi
 fi
 
+# make sure we can reach the web site
+CURL_CMD=curl
+set +e
+$CURL_CMD -sS -k -o /dev/null --retry-all-errors --retry-delay 3 --retry 5 "$BASE_URL" || {
+  set -e
+  if [ -n "${CONTAINER_ID+x}" ]; then
+    echo Reverting to using curl from within the HTTP container
+    $CONTAINER_CMD exec "$CONTAINER_ID" apt-get update -y
+    $CONTAINER_CMD exec "$CONTAINER_ID" apt-get install -y curl
+    CURL_CMD="$CONTAINER_CMD exec $CONTAINER_ID curl"
+    BASE_URL=https://localhost
+    $CURL_CMD -sS -k -o /dev/null --retry-all-errors --retry-delay 3 --retry 5 "$BASE_URL"
+  else
+    exit 1
+  fi
+}
+set -e
+
 TOTAL=0
 SUCCESS=0
 
@@ -98,7 +116,7 @@ function test {
 
   local output
   set +e
-  output=$(curl -k -w '%{http_code},%{redirect_url}\n' -o /dev/null -s "${url}")
+  output=$($CURL_CMD -k -w '%{http_code},%{redirect_url}' -o /dev/null -s "${url}")
   set -e
   TOTAL=$((TOTAL + 1))