Unverified Commit 60e5ba58 authored by Maxim Cournoyer's avatar Maxim Cournoyer
Browse files

Jenkinsfile: Migrate properties to declarative options/triggers.

Properties is a scripted pipeline concept and doesn't work correctly
in the context of a *declarative* pipeline.

* Jenkinsfile: Add 'ansicolor' to the list of requirements in the top
comment.
(properties): Remove.
(triggers): New directive.

Change-Id: Idceff87a005a935ff6af2931fd0ed466d0e73911
parent 15dd42ec
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
// Requirements: // Requirements:
// 1. gerrit-trigger plugin // 1. gerrit-trigger plugin
// 2. ws-cleanup plugin // 2. ws-cleanup plugin
// 3. ansicolor plugin
// Configuration globals. // Configuration globals.
def SUBMODULES = ['daemon', 'lrc', 'client-gnome', 'client-qt'] def SUBMODULES = ['daemon', 'lrc', 'client-gnome', 'client-qt']
...@@ -17,46 +18,28 @@ def REMOTE_BASE_DIR = '/srv/repository/ring' ...@@ -17,46 +18,28 @@ def REMOTE_BASE_DIR = '/srv/repository/ring'
def RING_PUBLIC_KEY_FINGERPRINT = 'A295D773307D25A33AE72F2F64CD5FA175348F84' def RING_PUBLIC_KEY_FINGERPRINT = 'A295D773307D25A33AE72F2F64CD5FA175348F84'
def SNAPCRAFT_KEY = '/var/lib/jenkins/.snap/key' def SNAPCRAFT_KEY = '/var/lib/jenkins/.snap/key'
properties(
[
[
$class: 'BuildDiscarderProperty',
strategy: [$class: 'LogRotator', numToKeepStr: '30']
],
pipelineTriggers([
[
$class: 'GerritTrigger',
gerritProjects: [
[
$class: "GerritProject",
pattern: "ring-project",
branches: [
[$class: "Branch", pattern: "master"]
]
]
],
triggerOnEvents: [
[
$class: "PluginPatchsetCreatedEvent",
excludeDrafts: true,
excludeTrivialRebase: true,
excludeNoCodeChange: true
],
[
$class: "PluginCommentAddedContainsEvent",
commentAddedCommentContains: '!build'
]
]
]
])
]
)
pipeline { pipeline {
agent { agent {
label 'guix' label 'guix'
} }
triggers {
gerrit customUrl: '',
gerritProjects: [
[branches: [[compareType: 'PLAIN', pattern: 'master']],
compareType: 'PLAIN',
disableStrictForbiddenFileVerification: false,
pattern: 'ring-project']],
triggerOnEvents: [
commentAddedContains('!build'),
patchsetCreated(excludeDrafts: true, excludeNoCodeChange: true,
excludeTrivialRebase: true)]
}
options {
ansiColor('xterm')
}
parameters { parameters {
string(name: 'GERRIT_REFSPEC', string(name: 'GERRIT_REFSPEC',
defaultValue: 'refs/heads/master', defaultValue: 'refs/heads/master',
...@@ -88,10 +71,6 @@ pipeline { ...@@ -88,10 +71,6 @@ pipeline {
TARBALLS = '/opt/ring-contrib' // set the cache directory TARBALLS = '/opt/ring-contrib' // set the cache directory
} }
options {
ansiColor('xterm')
}
stages { stages {
stage('Check configuration') { stage('Check configuration') {
when { not { expression { fileExists TARBALLS } } } when { not { expression { fileExists TARBALLS } } }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment