jjb: Add job to build and deploy bt2 website
[lttng-ci.git] / scripts / babeltrace-www / deploy.sh
CommitLineData
68b6e210
KS
1#!/bin/bash
2# shellcheck disable=SC2103
3#
4# Copyright (C) 2021 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
5#
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19set -exu
20
21RUBY_VERSION=2.7
22
23# Add ssh key for deployment
24cp "$HOST_PUBLIC_KEYS" ~/.ssh/known_hosts
25cp "$KEY_FILE_VARIABLE" ~/.ssh/id_rsa
26
27# Nodejs
28# Using Debian, as root
29apt-add-repository ppa:brightbox/ruby-ng
30apt-get install -y ruby${RUBY_VERSION} ruby${RUBY_VERSION}-dev ruby-switch ruby-bundler
31
32ruby-switch --list
33ruby-switch --set ruby${RUBY_VERSION}
34
35ruby -v
36export PATH="/root/.gem/ruby/${RUBY_VERSION}.0/bin:$PATH"
37bundle config set --local path "/root/.gem"
38
39
40apt-get install -y jekyll npm grunt python3 python3-pip python3-venv
41
42# babeltrace dependencies
43apt-get install -y asciidoc xmlto libdw-dev libelf-dev elfutils autoconf automake libglib2.0-dev make doxygen flex bison
44
45npm install
46
47python3 -m venv build_venv && source build_venv/bin/activate
48pip install -r requirements.txt
49
50# Setting TERM avoids spurious warnings when configure is checking TPUT, as
51# $TERM is not set in the build environment.
52# As we've already opened a venv, set SKIP_VENV so the python job doesn't
53# create a second nested virtual environment.
54TERM=dumb SKIP_VENV=1 grunt build:prod --verbose
55grunt deploy:prod --verbose
56
57# In the venv functions generated by the version of python installed on bionic
58# nodes, the deactivate function checks undefined variables (eg. $1) which causes
59# the build to fail when `set -u` is in effect.
60set +u
61deactivate
62
63# EOF
This page took 0.025389 seconds and 4 git commands to generate.