Browse Source

Remove obsolete CI configuration.

See spring-projects/spring-data-build#2764
4.0.x
Christoph Strobl 1 month ago committed by Mark Paluch
parent
commit
bcb049814a
No known key found for this signature in database
GPG Key ID: 55BC6374BAA9D973
  1. 6
      .github/workflows/ci.yml
  2. 6
      .github/workflows/snapshots.yml
  3. 28
      CI.adoc
  4. 134
      Jenkinsfile
  5. 2
      README.adoc
  6. 8
      ci/clean.sh
  7. 33
      ci/pipeline.properties
  8. 17
      ci/test.sh

6
.github/workflows/ci.yml

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
name: CI Build
on:
workflow_dispatch:
push:
branches: [ main, 4.0.x, 3.5.x, 'issue/**' ]
workflow_dispatch:
permissions: read-all
@ -17,13 +17,13 @@ jobs: @@ -17,13 +17,13 @@ jobs:
steps:
- uses: actions/checkout@v6
- name: Setup Java and Maven
uses: spring-projects/spring-data-release/actions/setup-maven@main
uses: spring-projects/spring-data-build/actions/setup-maven@4.0.x
with:
java-version: ${{ matrix.java-version }}
develocity-access-key: '${{ secrets.DEVELOCITY_ACCESS_KEY }}'
- name: Prepare Docker Container Licenses
run: ./ci/accept-third-party-license.sh
- name: Build
uses: spring-projects/spring-data-release/actions/maven-build@main
uses: spring-projects/spring-data-build/actions/maven-build@4.0.x
with:
run: ./mvnw -Dsort -B -U -Pall-dbs clean dependency:list verify

6
.github/workflows/snapshots.yml

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
name: Snapshots
on:
workflow_dispatch:
push:
branches: [ main, 4.0.x, 3.5.x, 'issue/**' ]
workflow_dispatch:
permissions: read-all
@ -15,13 +15,13 @@ jobs: @@ -15,13 +15,13 @@ jobs:
steps:
- uses: actions/checkout@v6
- name: Setup Java and Maven
uses: spring-projects/spring-data-release/actions/setup-maven@main
uses: spring-projects/spring-data-build/actions/setup-maven@4.0.x
with:
develocity-access-key: '${{ secrets.DEVELOCITY_ACCESS_KEY }}'
- name: Prepare Docker Container Licenses
run: ./ci/accept-third-party-license.sh
- name: Deploy to Artifactory
uses: spring-projects/spring-data-release/actions/maven-artifactory-deploy@main
uses: spring-projects/spring-data-build/actions/maven-artifactory-deploy@4.0.x
with:
build-name: 'spring-data-relational'
username: '${{ secrets.ARTIFACTORY_USERNAME }}'

28
CI.adoc

@ -1,30 +1,8 @@ @@ -1,30 +1,8 @@
= Continuous Integration
image:https://jenkins.spring.io/buildStatus/icon?job=spring-data-jdbc%2Fmain&subject=Moore%20(main)["Spring Data JDBC", link="https://jenkins.spring.io/view/SpringData/job/spring-data-jdbc/"]
image:https://jenkins.spring.io/buildStatus/icon?job=spring-data-jdbc%2F1.0.x&subject=Lovelace%20(1.0.x)["Spring Data JDBC", link="https://jenkins.spring.io/view/SpringData/job/spring-data-jdbc/"]
Make sure to accept 3rd party database licenses before running integration tests against all databases.
Run ci/accept-third-party-license.sh in doubt.
== Running CI tasks locally
Since this pipeline is purely Docker-based, it's easy to:
* Debug what went wrong on your local machine.
* Test out a tweak to your `test.sh` script before sending it out.
* Experiment against a new image before submitting your pull request.
All of these use cases are great reasons to essentially run what the CI server does on your local machine.
IMPORTANT: To do this you must have Docker installed on your machine.
1. `docker run -it --mount type=bind,source="$(pwd)",target=/spring-data-jdbc-github -v /usr/bin/docker:/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock adoptopenjdk/openjdk8:latest /bin/bash`
+
This will launch the Docker image and mount your source code at `spring-data-jdbc-github`.
+
2. `cd spring-data-jdbc-github`
+
Next, test everything from inside the container:
+
3. `./mvnw -Pci,all-dbs clean dependency:list test -Dsort -B` (or whatever test configuration you must use)
Since the container is binding to your source, you can make edits from your IDE and continue to run build jobs.
NOTE: Docker containers can eat up disk space fast! From time to time, run `docker system prune` to clean out old images.
You can run CI jobs locally using Docker and act[https://nektosact.com/].

134
Jenkinsfile vendored

@ -1,134 +0,0 @@ @@ -1,134 +0,0 @@
def p = [:]
node {
checkout scm
p = readProperties interpolate: true, file: 'ci/pipeline.properties'
}
pipeline {
agent none
triggers {
pollSCM 'H/10 * * * *'
upstream(upstreamProjects: "spring-data-commons/4.0.x", threshold: hudson.model.Result.SUCCESS)
}
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '14'))
}
stages {
stage("test: baseline (main)") {
when {
beforeAgent(true)
anyOf {
branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP")
not { triggeredBy 'UpstreamCause' }
}
}
agent {
label 'data'
}
options { timeout(time: 30, unit: 'MINUTES') }
environment {
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}")
TESTCONTAINERS_IMAGE_SUBSTITUTOR = 'org.springframework.data.ProxyImageNameSubstitutor'
}
steps {
script {
docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) {
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.docker']) {
sh "PROFILE=all-dbs JENKINS_USER_NAME=${p['jenkins.user.name']} ci/test.sh"
sh "JENKINS_USER_NAME=${p['jenkins.user.name']} ci/clean.sh"
}
}
}
}
}
stage("Test other configurations") {
when {
beforeAgent(true)
allOf {
branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP")
not { triggeredBy 'UpstreamCause' }
}
}
parallel {
stage("test: baseline (next)") {
agent {
label 'data'
}
options { timeout(time: 30, unit: 'MINUTES') }
environment {
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}")
TESTCONTAINERS_IMAGE_SUBSTITUTOR = 'org.springframework.data.ProxyImageNameSubstitutor'
}
steps {
script {
docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) {
docker.image(p['docker.java.next.image']).inside(p['docker.java.inside.docker']) {
sh "PROFILE=all-dbs JENKINS_USER_NAME=${p['jenkins.user.name']} ci/test.sh"
sh "JENKINS_USER_NAME=${p['jenkins.user.name']} ci/clean.sh"
}
}
}
}
}
}
}
stage('Release to artifactory') {
when {
beforeAgent(true)
anyOf {
branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP")
not { triggeredBy 'UpstreamCause' }
}
}
agent {
label 'data'
}
options { timeout(time: 20, unit: 'MINUTES') }
environment {
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}")
}
steps {
script {
docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) {
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.docker']) {
sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' +
"./mvnw -s settings.xml -Pci,artifactory " +
"-Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root " +
"-Dartifactory.server=${p['artifactory.url']} " +
"-Dartifactory.username=${ARTIFACTORY_USR} " +
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
"-Dartifactory.staging-repository=${p['artifactory.repository.snapshot']} " +
"-Dartifactory.build-name=spring-data-relational " +
"-Dartifactory.build-number=spring-data-relational-${BRANCH_NAME}-build-${BUILD_NUMBER} " +
"-Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-jdbc " +
"-Dmaven.test.skip=true clean deploy -U -B"
}
}
}
}
}
}
post {
changed {
script {
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>")
}
}
}
}

2
README.adoc

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
= Spring Data Relational image:https://jenkins.spring.io/buildStatus/icon?job=spring-data-jdbc%2Fmain&subject=Build[link=https://jenkins.spring.io/view/SpringData/job/spring-data-jdbc/] image:https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A["Revved up by Develocity", link="https://ge.spring.io/scans?search.rootProjectNames=Spring Data Relational Parent"]
= Spring Data Relational image:https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A["Revved up by Develocity", link="https://ge.spring.io/scans?search.rootProjectNames=Spring Data Relational Parent"]
The primary goal of the https://projects.spring.io/spring-data[Spring Data] project is to make it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services.

8
ci/clean.sh

@ -1,8 +0,0 @@ @@ -1,8 +0,0 @@
#!/bin/bash -x
set -euo pipefail
export JENKINS_USER=${JENKINS_USER_NAME}
MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" \
./mvnw -s settings.xml -Dscan=false clean -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-jdbc -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root

33
ci/pipeline.properties

@ -1,33 +0,0 @@ @@ -1,33 +0,0 @@
# Java versions
java.main.tag=25.0.1_8-jdk-noble
java.next.tag=25.0.1_8-jdk-noble
# Docker container images - standard
docker.java.main.image=library/eclipse-temurin:${java.main.tag}
docker.java.next.image=library/eclipse-temurin:${java.next.tag}
# Supported versions of MongoDB
docker.mongodb.6.0.version=6.0.23
docker.mongodb.7.0.version=7.0.20
docker.mongodb.8.0.version=8.0.9
# Supported versions of Redis
docker.redis.6.version=6.2.13
docker.redis.7.version=7.2.4
docker.redis.8.version=8.2.2
docker.valkey.8.version=8.1.1
# Docker environment settings
docker.java.inside.basic=-v $HOME:/tmp/jenkins-home --ulimit nofile=32000:32000
docker.java.inside.docker=-u root -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker -v $HOME:/tmp/jenkins-home --ulimit nofile=32000:32000
# Credentials
docker.registry=
docker.credentials=hub.docker.com-springbuildmaster
docker.proxy.registry=https://docker-hub.usw1.packages.broadcom.com
docker.proxy.credentials=usw1_packages_broadcom_com-jenkins-token
artifactory.credentials=02bd1690-b54f-4c9f-819d-a77cb7a9822c
artifactory.url=https://repo.spring.io
artifactory.repository.snapshot=libs-snapshot-local
develocity.access-key=gradle_enterprise_secret_access_key
jenkins.user.name=spring-builds+jenkins

17
ci/test.sh

@ -1,17 +0,0 @@ @@ -1,17 +0,0 @@
#!/bin/bash -x
set -euo pipefail
ci/accept-third-party-license.sh
echo "Copying ProxyImageNameSubstitutor into JDBC and R2DBC..."
cp spring-data-relational/src/test/java/org/springframework/data/ProxyImageNameSubstitutor.java spring-data-jdbc/src/test/java/org/springframework/data
cp spring-data-relational/src/test/java/org/springframework/data/ProxyImageNameSubstitutor.java spring-data-r2dbc/src/test/java/org/springframework/data
mkdir -p /tmp/jenkins-home
export JENKINS_USER=${JENKINS_USER_NAME}
MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" \
./mvnw -s settings.xml \
-P${PROFILE} clean dependency:list verify -Dsort -U -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-jdbc -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root
Loading…
Cancel
Save