X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=scripts%2Fbabeltrace-www%2Fdeploy.sh;fp=scripts%2Fbabeltrace-www%2Fdeploy.sh;h=617e4ed33657aeb902f9c2e8d39c4137c078ad04;hb=68b6e210ccd244bcad640c2034695582929b797c;hp=0000000000000000000000000000000000000000;hpb=0c50633c4c844534e40eb4f990e844264a4dc552;p=lttng-ci.git diff --git a/scripts/babeltrace-www/deploy.sh b/scripts/babeltrace-www/deploy.sh new file mode 100644 index 0000000..617e4ed --- /dev/null +++ b/scripts/babeltrace-www/deploy.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# shellcheck disable=SC2103 +# +# Copyright (C) 2021 Jonathan Rajotte-Julien +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +set -exu + +RUBY_VERSION=2.7 + +# Add ssh key for deployment +cp "$HOST_PUBLIC_KEYS" ~/.ssh/known_hosts +cp "$KEY_FILE_VARIABLE" ~/.ssh/id_rsa + +# Nodejs +# Using Debian, as root +apt-add-repository ppa:brightbox/ruby-ng +apt-get install -y ruby${RUBY_VERSION} ruby${RUBY_VERSION}-dev ruby-switch ruby-bundler + +ruby-switch --list +ruby-switch --set ruby${RUBY_VERSION} + +ruby -v +export PATH="/root/.gem/ruby/${RUBY_VERSION}.0/bin:$PATH" +bundle config set --local path "/root/.gem" + + +apt-get install -y jekyll npm grunt python3 python3-pip python3-venv + +# babeltrace dependencies +apt-get install -y asciidoc xmlto libdw-dev libelf-dev elfutils autoconf automake libglib2.0-dev make doxygen flex bison + +npm install + +python3 -m venv build_venv && source build_venv/bin/activate +pip install -r requirements.txt + +# Setting TERM avoids spurious warnings when configure is checking TPUT, as +# $TERM is not set in the build environment. +# As we've already opened a venv, set SKIP_VENV so the python job doesn't +# create a second nested virtual environment. +TERM=dumb SKIP_VENV=1 grunt build:prod --verbose +grunt deploy:prod --verbose + +# In the venv functions generated by the version of python installed on bionic +# nodes, the deactivate function checks undefined variables (eg. $1) which causes +# the build to fail when `set -u` is in effect. +set +u +deactivate + +# EOF