forked from cyberark/conjur-spring-boot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-package.sh
executable file
·31 lines (25 loc) · 958 Bytes
/
build-package.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# Publish a Release to Artifactory and Maven Central
set -euo pipefail
mkdir -p maven_cache
# Jenkins reads the changelog and writes the latest version to a file called VERSION
# If a developer runs these scripts locally, the VERSION file won't exist, so
# we generate a placeholder VERSION file.
if [[ ! -r VERSION ]]; then
echo "0.0.1-SNAPSHOT" > VERSION
fi
# Use tools image to update version in pom file to match the version in CHANGELOG.md
docker run \
--volume "${PWD}:${PWD}" \
--volume "${PWD}/maven_cache":/root/.m2 \
--workdir "${PWD}" \
tools \
mvn --batch-mode versions:set -DnewVersion="$(<VERSION)" -Dmaven.test.skip
# TODO: Update sample app dependency to use this version.
# Use Tools image to package code
docker run \
--volume "${PWD}:${PWD}" \
--volume "${PWD}/maven_cache":/root/.m2 \
--workdir "${PWD}" \
tools \
mvn --batch-mode -f pom.xml package -Dmaven.test.skip