blob: 4da56c13910b55ddb954cd984e4b20e39e58d528 [file] [log] [blame]
simon9d12dc42022-10-27 23:12:20 -04001/*
2 * Copyright (C) 2022 Savoir-faire Linux Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as
6 * published by the Free Software Foundation; either version 3 of the
7 * License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Affero General Public License for more details.
13 *
14 * You should have received a copy of the GNU Affero General Public
15 * License along with this program. If not, see
16 * <https://www.gnu.org/licenses/>.
17 */
18
19// Requirements:
20// - gerrit-trigger plugin
21// - Docker plugin
simona45c7012022-10-28 16:10:14 -040022// - ansicolor plugin
simon9d12dc42022-10-27 23:12:20 -040023
24pipeline {
25 agent any
simona45c7012022-10-28 16:10:14 -040026
27 triggers {
28 gerrit customUrl: '',
29 gerritProjects: [
30 [branches: [[compareType: 'PLAIN', pattern: 'master']],
31 compareType: 'PLAIN',
32 disableStrictForbiddenFileVerification: false,
Sébastien Blinf025c682022-10-30 13:08:19 -040033 pattern: 'jami-web']],
simona45c7012022-10-28 16:10:14 -040034 triggerOnEvents: [
35 commentAddedContains('!build'),
36 patchsetCreated(excludeDrafts: true, excludeNoCodeChange: true,
37 excludeTrivialRebase: true)]
38 }
39
40 options {
41 ansiColor('xterm')
42 }
43
44 parameters {
45 string(name: 'GERRIT_REFSPEC',
46 defaultValue: 'refs/heads/master',
47 description: 'The Gerrit refspec to fetch.')
48 }
49
simon9d12dc42022-10-27 23:12:20 -040050 stages {
simona45c7012022-10-28 16:10:14 -040051 stage('Initialize submodules') {
52 steps {
53 sh "git submodule update --init --recursive"
54 }
55 }
simon9d12dc42022-10-27 23:12:20 -040056 stage('Build jami-daemon') {
57 steps {
58 dir("daemon") {
59 sh "docker build --build-arg config_args=\"--with-nodejs\" -t jami-daemon ."
60 }
61 }
62 }
Misha Krieger-Raynauld173fbba2022-11-16 14:10:38 -050063 stage('Lint & test') {
simon9d12dc42022-10-27 23:12:20 -040064 steps {
65 script {
66 docker.build("jami-web:${env.BUILD_ID}", "--target test .")
67 }
68 }
69 }
70 stage('Build') {
71 steps {
72 script {
73 docker.build("jami-web:${env.BUILD_ID}", "--target build .")
74 }
75 }
76 }
77 }
78}