This change contributes the CI scripts required to build and release the
project.

Signed-off-by: Ben Hale <bhale@vmware.com>
This commit is contained in:
Ben Hale
2020-07-01 09:10:19 -07:00
parent df4abb7b21
commit 4e37346e2d
11 changed files with 209 additions and 0 deletions

5
scripts/Dockerfile Normal file
View File

@@ -0,0 +1,5 @@
FROM bellsoft/liberica-openjdk-debian:11
RUN apt-get update && apt-get install --no-install-recommends -y \
git \
&& rm -rf /var/lib/apt/lists/*

21
scripts/bump-major.yml Normal file
View File

@@ -0,0 +1,21 @@
---
platform: linux
image_resource:
type: registry-image
source:
repository: cfje/spring-cloud-bindings
inputs:
- name: source
caches:
- path: maven
outputs:
- name: source
run:
path: source/scripts/bump-version.sh
args:
- major

21
scripts/bump-minor.yml Normal file
View File

@@ -0,0 +1,21 @@
---
platform: linux
image_resource:
type: registry-image
source:
repository: cfje/spring-cloud-bindings
inputs:
- name: source
caches:
- path: maven
outputs:
- name: source
run:
path: source/scripts/bump-version.sh
args:
- minor

21
scripts/bump-patch.yml Normal file
View File

@@ -0,0 +1,21 @@
---
platform: linux
image_resource:
type: registry-image
source:
repository: cfje/spring-cloud-bindings
inputs:
- name: source
caches:
- path: maven
outputs:
- name: source
run:
path: source/scripts/bump-version.sh
args:
- patch

44
scripts/bump-version.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
set -euo pipefail
[[ -d "${PWD}"/maven && ! -d "${HOME}"/.m2 ]] && ln -s "${PWD}"/maven "${HOME}"/.m2
if [[ "$#" -ne 1 ]]; then
printf "%s [ major | minor | patch ]\n" "$(basename "$0")"
exit 1
fi
case "$1" in
major )
printf "Bumping major\n"
VERSION_PATTERN='${parsedVersion.nextMajorVersion}.0.0-SNAPSHOT'
;;
minor )
printf "Bumping minor\n"
VERSION_PATTERN='${parsedVersion.majorVersion}.${parsedVersion.nextMinorVersion}.0-SNAPSHOT'
;;
patch )
printf "Bumping patch\n"
VERSION_PATTERN='${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.nextIncrementalVersion}-SNAPSHOT'
;;
* )
printf "Unknown bump type %s\n" "$1"
exit 1
;;
esac
cd source
./mvnw build-helper:parse-version versions:set -DgenerateBackupPoms=false -DnewVersion="${VERSION_PATTERN}"
VERSION=$(./mvnw --quiet help:evaluate -DforceStdout -Dexpression=project.version)
git add pom.xml
git checkout -- .
git \
-c user.name='Paketo Robot' \
-c user.email='robot@paketo.io' \
commit \
--signoff \
--message "v${VERSION} Development"

11
scripts/deploy.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail
[[ -d "${PWD}"/maven && ! -d "${HOME}"/.m2 ]] && ln -s "${PWD}"/maven "${HOME}"/.m2
REPOSITORY="${PWD}"/repository
cd source
./mvnw deploy -Dmaven.test.skip=true -DaltDeploymentRepository="local::default::file://${REPOSITORY}"

19
scripts/deploy.yml Normal file
View File

@@ -0,0 +1,19 @@
---
platform: linux
image_resource:
type: registry-image
source:
repository: cfje/spring-cloud-bindings
inputs:
- name: source
caches:
- path: maven
outputs:
- name: repository
run:
path: source/scripts/deploy.sh

22
scripts/release-version.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail
[[ -d "${PWD}"/maven && ! -d "${HOME}"/.m2 ]] && ln -s "${PWD}"/maven "${HOME}"/.m2
cd source
./mvnw versions:set -DremoveSnapshot=true -DgenerateBackupPoms=false
VERSION=$(./mvnw --quiet help:evaluate -DforceStdout -Dexpression=project.version)
git add pom.xml
git checkout -- .
git \
-c user.name='Paketo Robot' \
-c user.email='robot@paketo.io' \
commit \
--signoff \
--message "v${VERSION} Release"
echo -n "${VERSION}" > ../version/version

View File

@@ -0,0 +1,20 @@
---
platform: linux
image_resource:
type: registry-image
source:
repository: cfje/spring-cloud-bindings
inputs:
- name: source
caches:
- path: maven
outputs:
- name: source
- name: version
run:
path: source/scripts/release-version.sh

9
scripts/test.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail
[[ -d "${PWD}"/maven && ! -d "${HOME}"/.m2 ]] && ln -s "${PWD}"/maven "${HOME}"/.m2
cd source
./mvnw test

16
scripts/test.yml Normal file
View File

@@ -0,0 +1,16 @@
---
platform: linux
image_resource:
type: registry-image
source:
repository: cfje/spring-cloud-bindings
inputs:
- name: source
caches:
- path: maven
run:
path: source/scripts/test.sh