From: Kienan Stewart Date: Wed, 7 Jun 2023 19:26:57 +0000 (-0400) Subject: jjb: Add job to build and deploy efficios.com X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5b461c35e28ee2444813500e5b4ef9f47c4e3da0;p=lttng-ci.git jjb: Add job to build and deploy efficios.com Change-Id: Ie61384f0c99bdf0ffab57b7156296c5f3ca59362 --- diff --git a/jobs/efficios-www.yaml b/jobs/efficios-www.yaml new file mode 100644 index 0000000..19cd30a --- /dev/null +++ b/jobs/efficios-www.yaml @@ -0,0 +1,75 @@ +- job: + name: efficios-www + project-type: freestyle + defaults: global + node: amd64-rootnode-jammy + + description: | + This job is responsible for updating the efficios website. + +

Job is managed by Jenkins Job Builder.

+ + wrappers: + - ansicolor + - timestamps + - credentials-binding: + - ssh-user-private-key: + credential-id: f3c907b6-7485-49e1-afe1-4df24fac4ca1 + key-file-variable: KEY_FILE_VARIABLE + username-variable: USER_NAME_VARIABLE + passphrase-variable: PASSPHRASE_VARIABLE + - file: + credential-id: d023f830-9ab0-409f-b977-8cd0e1944dd5 + variable: HOST_PUBLIC_KEYS + properties: + - build-discarder: + num-to-keep: 5 + + triggers: + - pollscm: + cron: "@hourly" + builders: + - shell: + !include-raw: scripts/efficios-www/deploy.sh + + scm: + - efficios-www + + publishers: + - ircbot: + strategy: statechange-only + message-type: summary + matrix-notifier: only-parent + - 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: efficios-www + scm: + - git: + url: git@git.internal.efficios.com:efficios/efficios-www.git + credentials-id: f3c907b6-7485-49e1-afe1-4df24fac4ca1 + basedir: ./ + skip-tag: true + branches: + - master diff --git a/scripts/efficios-www/deploy.sh b/scripts/efficios-www/deploy.sh new file mode 100644 index 0000000..7a9ef22 --- /dev/null +++ b/scripts/efficios-www/deploy.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# shellcheck disable=SC2103 +# +# Copyright (C) 2022 Kienan Stewart +# +# 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 +cp "$HOST_PUBLIC_KEYS" ~/.ssh/known_hosts +cp "$KEY_FILE_VARIABLE" ~/.ssh/id_rsa + +# Nodejs +apt-get install -y npm +./bootstrap-ubuntu.sh +npm install + +grunt build:dev --verbose +grunt deploy:pre --verbose + +grunt build:prod --verbose +grunt deploy:prod --verbose +# EOF