Debian Codegraph @

distribution/release-jdk8

raw
1 #!/bin/bash
2
3 function user_continue() {
4 read -p "Do you want to continue? [y/n]" -n 1 -r
5 echo
6 if [[ ! $REPLY =~ ^[Yy]$ ]]; then
7 exit 1
8 fi
9 }
10
11 if [ "$#" -ne 3 ]; then
12 echo "USAGE: `basename $0` <release-version> <sonatype-user> <sonatype-passwd>"
13 exit
14 fi
15
16 RELEASE_VERSION="${1}"
17 SONATYPE_USER="${2}"
18 SONATYPE_PASSWORD="${3}"
19 echo "================================================================="
20 echo "This script will clone the release tag v${RELEASE_VERSION} and build the JDK8 binaries"
21 echo "================================================================="
22 user_continue
23
24 # checkout the release tag
25 mkdir -p target
26 git clone --depth 1 --branch v${RELEASE_VERSION} [email protected]:vt-middleware/ldaptive.git target/ldaptive-jdk8-build
27 pushd target/ldaptive-jdk8-build
28
29 # build the bundle
30 ./mvn_cmd --with-jdk8 clean
31 ./mvn_cmd --with-jdk8 install
32 ./mvn_cmd --with-jdk8 bundle-create
33
34 # upload bundle jars to sonatype
35 echo "Uploading bundle jars to sonatype"
36 user_continue
37
38 curl -i -u ${SONATYPE_USER}:${SONATYPE_PASSWORD} \
39 -F "file=@jdk8/target/ldaptive-parent-jdk8-"${RELEASE_VERSION}"-bundle.jar" \
40 "https://oss.sonatype.org/service/local/staging/bundle_upload"
41 curl -i -u ${SONATYPE_USER}:${SONATYPE_PASSWORD} \
42 -F "file=@jdk8/core/target/ldaptive-jdk8-"${RELEASE_VERSION}"-bundle.jar" \
43 "https://oss.sonatype.org/service/local/staging/bundle_upload"
44 curl -i -u ${SONATYPE_USER}:${SONATYPE_PASSWORD} \
45 -F "file=@jdk8/json/target/ldaptive-json-jdk8-"${RELEASE_VERSION}"-bundle.jar" \
46 "https://oss.sonatype.org/service/local/staging/bundle_upload"
47 curl -i -u ${SONATYPE_USER}:${SONATYPE_PASSWORD} \
48 -F "file=@jdk8/beans/target/ldaptive-beans-jdk8-"${RELEASE_VERSION}"-bundle.jar" \
49 "https://oss.sonatype.org/service/local/staging/bundle_upload"
50 curl -i -u ${SONATYPE_USER}:${SONATYPE_PASSWORD} \
51 -F "file=@jdk8/templates/target/ldaptive-templates-jdk8-"${RELEASE_VERSION}"-bundle.jar" \
52 "https://oss.sonatype.org/service/local/staging/bundle_upload"
53
54 popd
55 echo "Finished JDK8 release ${RELEASE_VERSION} for ldaptive."