jjb: add job for lttng-www auto deploy
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 26 Feb 2021 15:49:26 +0000 (10:49 -0500)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 26 Feb 2021 15:49:26 +0000 (10:49 -0500)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
jobs/lttng-www.yaml [new file with mode: 0644]
scripts/lttng-www/deploy.sh [new file with mode: 0755]

diff --git a/jobs/lttng-www.yaml b/jobs/lttng-www.yaml
new file mode 100644 (file)
index 0000000..01e10cb
--- /dev/null
@@ -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.
+
+      <p>Job is managed by Jenkins Job Builder.</p>
+
+    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 (executable)
index 0000000..a9cd98a
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/bash
+# shellcheck disable=SC2103
+#
+# Copyright (C) 2021 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
+#
+# 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 <http://www.gnu.org/licenses/>.
+
+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
This page took 0.031198 seconds and 4 git commands to generate.