Skip to content

Commit dc8f6af

Browse files
rozzastIncMale
andauthored
Added publishing tasks to the build (#124)
Changes include: - evergreen updates to support publishing tasks - github workflows to trigger the release - javadoc updates: - Configure links to linked sources - Set encoding to UTF-8 - Fix no comment warnings in the code HIBERNATE-81 --------- Co-authored-by: Valentin Kovalenko <[email protected]>
1 parent 1396799 commit dc8f6af

File tree

16 files changed

+424
-18
lines changed

16 files changed

+424
-18
lines changed

.evergreen/config.yml

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ functions:
4444

4545
bootstrap-mongo-orchestration:
4646
- command: subprocess.exec
47+
type: test
4748
params:
4849
binary: bash
4950
include_expansions_in_env:
@@ -54,6 +55,7 @@ functions:
5455
- ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
5556
# run-orchestration generates expansion file with the MONGODB_URI for the cluster
5657
- command: expansions.update
58+
type: test
5759
params:
5860
file: mo-expansion.yml
5961

@@ -93,11 +95,11 @@ post:
9395
#######################################
9496
tasks:
9597
- name: static-analysis
96-
type: test
9798
tags:
9899
- pr
99100
commands:
100101
- command: subprocess.exec
102+
type: test
101103
params:
102104
working_dir: src
103105
binary: bash
@@ -107,11 +109,11 @@ tasks:
107109
- static-checks.sh
108110

109111
- name: run-unit-tests
110-
type: test
111112
tags:
112113
- pr
113114
commands:
114115
- command: subprocess.exec
116+
type: test
115117
params:
116118
working_dir: src
117119
binary: bash
@@ -121,12 +123,12 @@ tasks:
121123
- run-unit-tests.sh
122124

123125
- name: run-integration-tests
124-
type: test
125126
tags:
126127
- pr
127128
commands:
128129
- func: bootstrap-mongo-orchestration
129130
- command: subprocess.exec
131+
type: test
130132
params:
131133
working_dir: src
132134
binary: bash
@@ -135,6 +137,44 @@ tasks:
135137
args:
136138
- run-integration-tests.sh
137139

140+
- name: publish-snapshot
141+
depends_on:
142+
- variant: static-checks
143+
name: static-analysis
144+
commands:
145+
- command: subprocess.exec
146+
params:
147+
working_dir: src
148+
binary: bash
149+
add_to_path:
150+
- .evergreen
151+
env:
152+
NEXUS_USERNAME: ${nexus_username}
153+
NEXUS_PASSWORD: ${nexus_password}
154+
SIGNING_PASSWORD: ${signing_password}
155+
SIGNING_KEY: ${signing_key}
156+
RELEASE: "false"
157+
args:
158+
- .evergreen/publish.sh
159+
160+
- name: publish-release
161+
git_tag_only: true
162+
commands:
163+
- command: subprocess.exec
164+
params:
165+
working_dir: src
166+
binary: bash
167+
add_to_path:
168+
- .evergreen
169+
env:
170+
NEXUS_USERNAME: ${nexus_username}
171+
NEXUS_PASSWORD: ${nexus_password}
172+
SIGNING_PASSWORD: ${signing_password}
173+
SIGNING_KEY: ${signing_key}
174+
RELEASE: "true"
175+
args:
176+
- .evergreen/publish.sh
177+
138178
########################################
139179
# Axes #
140180
########################################
@@ -199,3 +239,15 @@ buildvariants:
199239
- pr
200240
tasks:
201241
- name: run-integration-tests
242+
243+
- name: publish-snapshot
244+
display_name: "Publish Snapshot"
245+
run_on: rhel80-small
246+
tasks:
247+
- name: publish-snapshot
248+
249+
- name: publish-release
250+
display_name: "Publish Release"
251+
run_on: rhel80-small
252+
tasks:
253+
- name: publish-release

.evergreen/create-expansions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# Get the current unique version of this checkout.
44
if [[ "$is_patch" = true ]]; then

.evergreen/fetch-drivers-tools.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -o errexit
44

.evergreen/java-config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# Java configurations for evergreen
44

.evergreen/publish.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
3+
# DO NOT ECHO COMMANDS AS THEY CONTAIN SECRETS!
4+
5+
set -o errexit # Exit the script with error if any of the commands fail
6+
7+
############################################
8+
# Main Program #
9+
############################################
10+
source java-config.sh
11+
12+
RELEASE=${RELEASE:false}
13+
14+
export ORG_GRADLE_PROJECT_nexusUsername=${NEXUS_USERNAME}
15+
export ORG_GRADLE_PROJECT_nexusPassword=${NEXUS_PASSWORD}
16+
export ORG_GRADLE_PROJECT_signingKey="${SIGNING_KEY}"
17+
export ORG_GRADLE_PROJECT_signingPassword=${SIGNING_PASSWORD}
18+
19+
if [ "$RELEASE" == "true" ]; then
20+
TASK="publishArchives closeSonatypeStagingRepository" # TODO-HIBERNATE-128 - update to closeAndReleaseSonatypeStagingRepository
21+
else
22+
TASK="publishSnapshots"
23+
fi
24+
25+
SYSTEM_PROPERTIES="-Dorg.gradle.internal.publish.checksums.insecure=true"
26+
27+
./gradlew -version
28+
./gradlew ${SYSTEM_PROPERTIES} --stacktrace --info ${TASK}

.evergreen/run-integration-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -o xtrace # Write all commands first to stderr
44
set -o errexit # Exit the script with error if any of the commands fail

.evergreen/run-unit-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -o xtrace # Write all commands first to stderr
44
set -o errexit # Exit the script with error if any of the commands fail

.evergreen/static-checks.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -o xtrace # Write all commands first to stderr
44
set -o errexit # Exit the script with error if any of the commands fail

.github/workflows/bump-and-tag.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
if [ "$#" -ne 3 ]; then
5+
echo "Usage: $0 <current version> <release version> <next version>" >&2
6+
exit 1
7+
fi
8+
9+
CURRENT_VERSION=$1
10+
RELEASE_VERSION=$2
11+
NEXT_VERSION=$3
12+
13+
SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]})
14+
15+
echo "Bump version in gradle.properties to ${RELEASE_VERSION}"
16+
${SCRIPT_DIR}/bump-version.sh "${RELEASE_VERSION_WITHOUT_SUFFIX}-SNAPSHOT" "${RELEASE_VERSION}"
17+
18+
echo "Create release tag for ${RELEASE_VERSION}"
19+
git tag -a -m "${RELEASE_VERSION}" r${RELEASE_VERSION}
20+
21+
echo "Bump to snapshot version for ${NEXT_VERSION}"
22+
${SCRIPT_DIR}/bump-version.sh "${RELEASE_VERSION}" "${NEXT_VERSION}-SNAPSHOT"

.github/workflows/bump-version.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
if [ "$#" -ne 2 ]; then
5+
echo "Usage: $0 <old version> <new version>" >&2
6+
exit 1
7+
fi
8+
9+
FROM_VERSION=$1
10+
TO_VERSION=$2
11+
12+
sed --in-place "s/version=${FROM_VERSION}/version=${TO_VERSION}/g" gradle.properties
13+
git commit -m "Version: bump ${TO_VERSION}" gradle.properties

0 commit comments

Comments
 (0)