From 8a02037bf9bc1e630ad4dfe43ba2193dd3dd9481 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Fri, 26 Feb 2021 10:49:26 -0500 Subject: [PATCH] jjb: add job for lttng-www auto deploy Signed-off-by: Jonathan Rajotte --- jobs/lttng-www.yaml | 65 +++++++++++++++++++++++++++++++++++++ scripts/lttng-www/deploy.sh | 42 ++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 jobs/lttng-www.yaml create mode 100755 scripts/lttng-www/deploy.sh diff --git a/jobs/lttng-www.yaml b/jobs/lttng-www.yaml new file mode 100644 index 0000000..01e10cb --- /dev/null +++ b/jobs/lttng-www.yaml @@ -0,0 +1,65 @@ +- job: + name: lttng-www + project-type: freestyle + defaults: global + node: amd64-rootnode + + description: | + This job is responsible for updating the lttng website. + +

Job is managed by Jenkins Job Builder.

+ + wrappers: + - ansicolor + - timestamps + - credentials-binding: + - ssh-user-private-key: + credential-id: 63a5abb5-9056-47e2-b419-f5946c1b8f08 + key-file-variable: KEY_FILE_VARIABLE + username-variable: USER_NAME_VARIABLE + passphrase-variable: PASSPHRASE_VARIABLE + + triggers: + - timed: '@daily' + builders: + - shell: + !include-raw: scripts/lttng-www/deploy.sh + + scm: + - lttng-www + + publishers: + - email-ext: + recipients: 'ci-notification@lists.lttng.org' + reply-to: ci-notification@lists.lttng.org + always: false + unstable: false + first-failure: true + first-unstable: true + not-built: false + aborted: false + regression: false + failure: false + second-failure: false + improvement: false + still-failing: false + success: false + fixed: false + fixed-unhealthy: true + still-unstable: false + pre-build: false + matrix-trigger: only-parent + send-to: + - recipients + +- scm: + name: lttng-www + scm: + - git: + url: git@git.efficios.com:lttng-www.git + credentials-id: 63a5abb5-9056-47e2-b419-f5946c1b8f08 + basedir: ./ + skip-tag: true + branches: + - master + diff --git a/scripts/lttng-www/deploy.sh b/scripts/lttng-www/deploy.sh new file mode 100755 index 0000000..a9cd98a --- /dev/null +++ b/scripts/lttng-www/deploy.sh @@ -0,0 +1,42 @@ +#!/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 + +# Add ssh key for deployment +echo "StrictHostKeyChecking no" >> ~/.ssh/config +cp "$KEY_FILE_VARIABLE" ~/.ssh/id_rsa + +# lttng-www dependencies + +# 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 asciidoc xmlto + +npm install -g grunt-cli +npm install -g sass + +./bootstrap-ubuntu.sh + +grunt build:prod +grunt deploy:prod + +# EOF -- 2.34.1