From b8326e6db6a2bd72029d9fb9f8fb52d37b55c22c Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Fri, 26 May 2017 11:12:23 -0700 Subject: [PATCH 1/2] Jenkinsfile: Switch to declarative-style Jenkins pipeline --- Jenkinsfile | 92 +++++++++++++++++++++++++++-------------------------- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 956ba807..dc2a1b60 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,46 +1,48 @@ -properties([ - [$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', numToKeepStr: '20']], - [$class: 'GithubProjectProperty', projectUrlStr: 'https://github.com/coreos/matchbox'], - [$class: 'PipelineTriggersJobProperty', triggers: [ - [$class: 'GitHubPushTrigger'], - ]] -]) -parallel ( - etcd3: { - node('fedora && bare-metal') { - stage('etcd3') { - timeout(time:5, unit:'MINUTES') { - checkout scm - sh '''#!/bin/bash -e - export ASSETS_DIR=~/assets; ./tests/smoke/etcd3 - ''' - } - } +pipeline { + agent none + + options { + timeout(time:45, unit:'MINUTES') + buildDiscarder(logRotator(numToKeepStr:'20')) + } + + stages { + stage('Cluster Tests') { + steps { + parallel ( + etcd3: { + node('fedora && bare-metal') { + timeout(time:5, unit:'MINUTES') { + checkout scm + sh '''#!/bin/bash -e + export ASSETS_DIR=~/assets; ./tests/smoke/etcd3 + ''' + } + } + }, + bootkube: { + node('fedora && bare-metal') { + timeout(time:12, unit:'MINUTES') { + checkout scm + sh '''#!/bin/bash -e + chmod 600 ./tests/smoke/fake_rsa + export ASSETS_DIR=~/assets; ./tests/smoke/bootkube + ''' + } + } + }, + "etcd3-terraform": { + node('fedora && bare-metal') { + timeout(time:10, unit:'MINUTES') { + checkout scm + sh '''#!/bin/bash -e + export ASSETS_DIR=~/assets; export CONFIG_DIR=~/matchbox/examples/etc/matchbox; ./tests/smoke/etcd3-terraform + ''' + } + } + }, + ) + } } - }, - bootkube: { - node('fedora && bare-metal') { - stage('bootkube') { - timeout(time:12, unit:'MINUTES') { - checkout scm - sh '''#!/bin/bash -e - chmod 600 ./tests/smoke/fake_rsa - export ASSETS_DIR=~/assets; ./tests/smoke/bootkube - ''' - } - } - } - }, - "etcd3-terraform": { - node('fedora && bare-metal') { - stage('etcd3-terraform') { - timeout(time:10, unit:'MINUTES') { - checkout scm - sh '''#!/bin/bash -e - export ASSETS_DIR=~/assets; export CONFIG_DIR=~/matchbox/examples/etc/matchbox; ./tests/smoke/etcd3-terraform - ''' - } - } - } - }, -) + } +} From b1a866370ad2ac494375ba2403babbdbc1a3fe62 Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Fri, 26 May 2017 14:40:34 -0700 Subject: [PATCH 2/2] Jenkinsfile: Cleanup workspace directories --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index dc2a1b60..0f4c9df4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,6 +17,7 @@ pipeline { sh '''#!/bin/bash -e export ASSETS_DIR=~/assets; ./tests/smoke/etcd3 ''' + deleteDir() } } }, @@ -28,6 +29,7 @@ pipeline { chmod 600 ./tests/smoke/fake_rsa export ASSETS_DIR=~/assets; ./tests/smoke/bootkube ''' + deleteDir() } } }, @@ -38,6 +40,7 @@ pipeline { sh '''#!/bin/bash -e export ASSETS_DIR=~/assets; export CONFIG_DIR=~/matchbox/examples/etc/matchbox; ./tests/smoke/etcd3-terraform ''' + deleteDir() } } },