simon | 9d12dc4 | 2022-10-27 23:12:20 -0400 | [diff] [blame] | 1 | /* |
| 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 |
simon | a45c701 | 2022-10-28 16:10:14 -0400 | [diff] [blame] | 22 | // - ansicolor plugin |
simon | 9d12dc4 | 2022-10-27 23:12:20 -0400 | [diff] [blame] | 23 | |
| 24 | pipeline { |
| 25 | agent any |
simon | a45c701 | 2022-10-28 16:10:14 -0400 | [diff] [blame] | 26 | |
| 27 | triggers { |
| 28 | gerrit customUrl: '', |
| 29 | gerritProjects: [ |
| 30 | [branches: [[compareType: 'PLAIN', pattern: 'master']], |
| 31 | compareType: 'PLAIN', |
| 32 | disableStrictForbiddenFileVerification: false, |
Sébastien Blin | f025c68 | 2022-10-30 13:08:19 -0400 | [diff] [blame] | 33 | pattern: 'jami-web']], |
simon | a45c701 | 2022-10-28 16:10:14 -0400 | [diff] [blame] | 34 | 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 | |
simon | 9d12dc4 | 2022-10-27 23:12:20 -0400 | [diff] [blame] | 50 | stages { |
simon | a45c701 | 2022-10-28 16:10:14 -0400 | [diff] [blame] | 51 | stage('Initialize submodules') { |
| 52 | steps { |
| 53 | sh "git submodule update --init --recursive" |
| 54 | } |
| 55 | } |
simon | 9d12dc4 | 2022-10-27 23:12:20 -0400 | [diff] [blame] | 56 | 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-Raynauld | 173fbba | 2022-11-16 14:10:38 -0500 | [diff] [blame] | 63 | stage('Lint & test') { |
simon | 9d12dc4 | 2022-10-27 23:12:20 -0400 | [diff] [blame] | 64 | 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 | } |