File tree 9 files changed +44
-66
lines changed 9 files changed +44
-66
lines changed Original file line number Diff line number Diff line change @@ -15,13 +15,31 @@ if [[ "$BUILDKITE_COMMAND" =~ .*"upload".* ]]; then
15
15
fi
16
16
17
17
if [ " $BUILDKITE_PIPELINE_SLUG " == " elastic-otel-java-snapshot" ]; then
18
- source .buildkite/hooks/prepare-release.sh
18
+ source .buildkite/hooks/prepare-release.sh
19
19
fi
20
20
21
21
if [ " $BUILDKITE_PIPELINE_SLUG " == " elastic-otel-java-release" ]; then
22
- source .buildkite/hooks/prepare-release.sh
22
+ source .buildkite/hooks/prepare-release.sh
23
23
fi
24
24
25
- # Run always
26
- source .buildkite/hooks/prepare-common.sh
25
+ # Configure the java version
26
+ JAVA_VERSION=$( cat .java-version | xargs | tr -dc ' [:print:]' )
27
+ JAVA_HOME=" ${HOME} /.java/openjdk${JAVA_VERSION} "
28
+ export JAVA_HOME
29
+ PATH=" ${JAVA_HOME} /bin:$PATH "
30
+ export PATH
27
31
32
+ # Fallback to install at runtime
33
+ if [ ! -d " ${JAVA_HOME} " ] ; then
34
+ # This should not be the case normally untless the .java-version file has been changed
35
+ # and the VM Image is not yet available with the latest version.
36
+ echo " --- Install JDK${JAVA_VERSION} :java:"
37
+ JAVA_URL=https://jvm-catalog.elastic.co/jdk
38
+ JAVA_PKG=" ${JAVA_URL} /latest_openjdk_${JAVA_VERSION} _linux.tar.gz"
39
+ curl -L --output /tmp/jdk.tar.gz " ${JAVA_PKG} "
40
+ mkdir -p " ${JAVA_HOME} "
41
+ tar --extract --file /tmp/jdk.tar.gz --directory " ${JAVA_HOME} " --strip-components 1
42
+ fi
43
+
44
+ # Validate the java version
45
+ java -version
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
agents :
2
2
provider : " gcp"
3
+ image : " family/elastic-otel-java-ubuntu-2204"
3
4
4
5
steps :
5
6
- label : " Build and publish release"
Original file line number Diff line number Diff line change 1
1
agents :
2
2
provider : " gcp"
3
+ image : " family/elastic-otel-java-ubuntu-2204"
3
4
4
5
steps :
5
6
- label : " Build and publish snapshot"
Original file line number Diff line number Diff line change @@ -23,12 +23,12 @@ echo $PATH
23
23
java -version
24
24
25
25
publishArg=' '
26
- if [[ " $dry_run " == " true" ]] ; then
27
- echo " --- Build and publish the release :package: (dry-run)"
28
- publishArg=' publishAllPublicationsToDryRunRepository'
29
- else
26
+ if [[ " $dry_run " == " false" ]] ; then
30
27
echo " --- Build and publish the release :package:"
31
28
publishArg=' publishToSonatype closeAndReleaseStagingRepository'
29
+ else
30
+ echo " --- Build and publish the release :package: (dry-run)"
31
+ publishArg=' publishAllPublicationsToDryRunRepository'
32
32
fi
33
33
34
34
./gradlew \
Original file line number Diff line number Diff line change @@ -23,12 +23,12 @@ echo $PATH
23
23
java -version
24
24
25
25
publishArg=' '
26
- if [[ " $dry_run " == " true" ]] ; then
27
- echo " --- Build and publish the snapshot :package: (dry-run)"
28
- publishArg=' publishAllPublicationsToDryRunRepository'
29
- else
26
+ if [[ " $dry_run " == " false" ]] ; then
30
27
echo " --- Build and publish the snapshot :package:"
31
28
publishArg=' publishToSonatype closeAndReleaseStagingRepository'
29
+ else
30
+ echo " --- Build and publish the snapshot :package: (dry-run)"
31
+ publishArg=' publishAllPublicationsToDryRunRepository'
32
32
fi
33
33
34
34
./gradlew \
Original file line number Diff line number Diff line change @@ -26,18 +26,15 @@ jobs:
26
26
- name : Checkout
27
27
uses : actions/checkout@v4
28
28
29
- - name : Gradle JDK
30
- uses : actions/setup-java@v4
31
- with :
32
- distribution : temurin
33
- java-version : 17
34
- cache : gradle
35
-
36
29
- name : Gradle build, test and check
37
- uses : gradle/ gradle-build-action@v3
30
+ uses : ./.github/workflows/ gradle-goal
38
31
with :
39
- arguments : check
32
+ command : " ./gradlew check"
40
33
34
+ - name : Warmup gradle wrapper
35
+ uses : ./.github/workflows/gradle-goal
36
+ with :
37
+ command : " ./gradlew check"
41
38
- name : Store test results
42
39
if : success() || failure()
43
40
uses : actions/upload-artifact@v3
Original file line number Diff line number Diff line change @@ -4,10 +4,10 @@ name: gradle-goal
4
4
description : Install specific JDK and run a command
5
5
6
6
inputs :
7
- version :
8
- description : ' Java version'
9
- required : true
10
- default : ' 17 '
7
+ java- version-file :
8
+ description : ' The path to the .java- version file '
9
+ required : false
10
+ default : ' .java-version '
11
11
distribution :
12
12
description : ' Java distribution'
13
13
required : true
26
26
- name : Set up JDK
27
27
uses : actions/setup-java@v4
28
28
with :
29
- java-version : ${{ inputs.version }}
29
+ java-version-file : ${{ inputs.java- version-file }}
30
30
distribution : ${{ inputs.distribution }}
31
31
cache : ' gradle'
32
32
- run : ${{ inputs.command }}
Original file line number Diff line number Diff line change
1
+ 17
You can’t perform that action at this time.
0 commit comments