7 changed files with 174 additions and 84 deletions
@ -0,0 +1,86 @@ |
|||||||
|
pipeline { |
||||||
|
agent none |
||||||
|
|
||||||
|
triggers { |
||||||
|
pollSCM 'H/10 * * * *' |
||||||
|
upstream(upstreamProjects: "spring-data-commons/master", threshold: hudson.model.Result.SUCCESS) |
||||||
|
} |
||||||
|
|
||||||
|
options { |
||||||
|
disableConcurrentBuilds() |
||||||
|
} |
||||||
|
|
||||||
|
stages { |
||||||
|
stage("Test") { |
||||||
|
parallel { |
||||||
|
stage("test: baseline") { |
||||||
|
agent { |
||||||
|
docker { |
||||||
|
label 'data' |
||||||
|
image 'adoptopenjdk/openjdk8:latest' |
||||||
|
args '-u root -v /var/run/docker.sock:/var/run/docker.sock' // root but with no maven caching |
||||||
|
} |
||||||
|
} |
||||||
|
steps { |
||||||
|
sh "./mvnw -Pci,all-dbs clean dependency:list test -Dsort -B" |
||||||
|
sh "chown -R 1001:1001 target" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
stage('Release to artifactory') { |
||||||
|
when { |
||||||
|
branch 'issue/*' |
||||||
|
} |
||||||
|
agent { |
||||||
|
docker { |
||||||
|
image 'adoptopenjdk/openjdk8:latest' |
||||||
|
args '-v $HOME/.m2:/root/.m2' |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
environment { |
||||||
|
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c') |
||||||
|
} |
||||||
|
|
||||||
|
steps { |
||||||
|
sh "./mvnw -Pci,snapshot clean deploy -Dmaven.test.skip=true -B" |
||||||
|
} |
||||||
|
} |
||||||
|
stage('Release to artifactory with docs') { |
||||||
|
when { |
||||||
|
branch 'test' |
||||||
|
} |
||||||
|
agent { |
||||||
|
docker { |
||||||
|
image 'adoptopenjdk/openjdk8:latest' |
||||||
|
args '-v $HOME/.m2:/root/.m2' |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
environment { |
||||||
|
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c') |
||||||
|
} |
||||||
|
|
||||||
|
steps { |
||||||
|
sh "./mvnw -Pci,snapshot clean deploy -Dmaven.test.skip=true -B" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
post { |
||||||
|
changed { |
||||||
|
script { |
||||||
|
slackSend( |
||||||
|
color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger', |
||||||
|
channel: '#spring-data-dev', |
||||||
|
message: "${currentBuild.fullDisplayName} - `${currentBuild.currentResult}`\n${env.BUILD_URL}") |
||||||
|
emailext( |
||||||
|
subject: "[${currentBuild.fullDisplayName}] ${currentBuild.currentResult}", |
||||||
|
mimeType: 'text/html', |
||||||
|
recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']], |
||||||
|
body: "<a href=\"${env.BUILD_URL}\">${currentBuild.fullDisplayName} is reported as ${currentBuild.currentResult}</a>") |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -1,15 +0,0 @@ |
|||||||
#!/usr/bin/env bash |
|
||||||
|
|
||||||
set -euo pipefail |
|
||||||
|
|
||||||
[[ -d $PWD/maven && ! -d $HOME/.m2 ]] && ln -s $PWD/maven $HOME/.m2 |
|
||||||
|
|
||||||
spring_data_jdbc_artifactory=$(pwd)/spring-data-jdbc-artifactory |
|
||||||
|
|
||||||
rm -rf $HOME/.m2/repository/org/springframework/data 2> /dev/null || : |
|
||||||
|
|
||||||
cd spring-data-jdbc-github |
|
||||||
|
|
||||||
./mvnw deploy \ |
|
||||||
-Dmaven.test.skip=true \ |
|
||||||
-DaltDeploymentRepository=distribution::default::file://${spring_data_jdbc_artifactory} |
|
||||||
@ -1,20 +0,0 @@ |
|||||||
--- |
|
||||||
platform: linux |
|
||||||
|
|
||||||
image_resource: |
|
||||||
type: docker-image |
|
||||||
source: |
|
||||||
repository: openjdk |
|
||||||
tag: 8-jdk |
|
||||||
|
|
||||||
inputs: |
|
||||||
- name: spring-data-jdbc-github |
|
||||||
|
|
||||||
outputs: |
|
||||||
- name: spring-data-jdbc-artifactory |
|
||||||
|
|
||||||
caches: |
|
||||||
- path: maven |
|
||||||
|
|
||||||
run: |
|
||||||
path: spring-data-jdbc-github/ci/build.sh |
|
||||||
@ -1,11 +0,0 @@ |
|||||||
#!/bin/bash -x |
|
||||||
|
|
||||||
set -euo pipefail |
|
||||||
|
|
||||||
[[ -d $PWD/maven && ! -d $HOME/.m2 ]] && ln -s $PWD/maven $HOME/.m2 |
|
||||||
|
|
||||||
rm -rf $HOME/.m2/repository/org/springframework/data 2> /dev/null || : |
|
||||||
|
|
||||||
cd spring-data-jdbc-github |
|
||||||
|
|
||||||
./mvnw clean dependency:list test -Dsort -U -P${PROFILE} |
|
||||||
@ -1,20 +0,0 @@ |
|||||||
--- |
|
||||||
platform: linux |
|
||||||
|
|
||||||
image_resource: |
|
||||||
type: docker-image |
|
||||||
source: |
|
||||||
repository: openjdk |
|
||||||
tag: 8-jdk |
|
||||||
|
|
||||||
inputs: |
|
||||||
- name: spring-data-jdbc-github |
|
||||||
|
|
||||||
outputs: |
|
||||||
- name: spring-data-jdbc-artifactory |
|
||||||
|
|
||||||
caches: |
|
||||||
- path: maven |
|
||||||
|
|
||||||
run: |
|
||||||
path: spring-data-jdbc-github/ci/test.sh |
|
||||||
Loading…
Reference in new issue