jjb: efficios-www: move to deb12 builders
[lttng-ci.git] / scripts / lttng-www / deploy.sh
index 59a6ad45caa7981eb8fc76a99d9802c40e549b33..ac35fb515955ca662fc85202f4feb6716f501c0a 100755 (executable)
@@ -23,22 +23,43 @@ cp "$HOST_PUBLIC_KEYS" ~/.ssh/known_hosts
 cp "$KEY_FILE_VARIABLE" ~/.ssh/id_rsa
 
 # lttng-www dependencies
-
+export DPKG_FRONTEND=noninteractive
 # Nodejs
 # Using Debian, as root
-curl -fsSL https://deb.nodesource.com/setup_15.x | bash -
-apt-get install -y nodejs
-
-apt-get install -y ruby-dev asciidoc xmlto python3 python3-pip
+apt-get update
+apt-get install -y nodejs npm
+apt-get install -y ruby ruby-bundler ruby-dev
+ruby -v
 
+apt-get install -y asciidoc xmlto python3 python3-pip doclifter
 npm install -g grunt-cli
 npm install -g sass
 
-export PATH="/root/.gem/ruby/2.5.0/bin:$PATH"
+bundle config set --local path "vendor/bundle"
 
 ./bootstrap.sh
 
-grunt build:prod
-grunt deploy:prod
+bundle exec grunt build:prod --network
+
+apt-get install -y linkchecker
+bundle exec grunt connect:prod watch:prod &
+SERVER_PID="${!}"
+sleep 10 # While serve:prod starts up
+OUTPUT_FILE="$(mktemp -d)/linkchecker-out.csv"
+chown nobody "$(dirname "${OUTPUT_FILE}")"
+# @Note: Only internal links are checked by default
+if ! linkchecker -q -F "csv/utf-8/${OUTPUT_FILE}" http://localhost:10000/ ; then
+    echo "Linkchecker failed or found broken links"
+    cat "${OUTPUT_FILE}"
+    kill "${SERVER_PID}"
+    rm -rf "${OUTPUT_FILE}/.."
+    sleep 5 # Let serve:prod stop
+    exit 1
+else
+    rm -rf "${OUTPUT_FILE}/.."
+    kill "${SERVER_PID}"
+fi
+
+bundle exec grunt deploy:prod --network
 
 # EOF
This page took 0.023879 seconds and 4 git commands to generate.