Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Commit 6e4ee8a

Browse files
committed
test: option to use snapshot repository in an artifact registry [not for review]
1 parent 00070b7 commit 6e4ee8a

3 files changed

Lines changed: 56 additions & 9 deletions

File tree

.kokoro/build.sh

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,36 @@ source ${scriptDir}/common.sh
2727
mvn -version
2828
echo ${JOB_TYPE}
2929

30-
# attempt to install 3 times with exponential backoff (starting with 10 seconds)
31-
retry_with_backoff 3 10 \
32-
mvn install -B -V -ntp \
33-
-DskipTests=true \
34-
-Dclirr.skip=true \
35-
-Denforcer.skip=true \
36-
-Dmaven.javadoc.skip=true \
37-
-Dgcloud.download.skip=true \
38-
-T 1C
30+
# TODO: We'll change define this value in a different place later
31+
if [[ "${JOB_TYPE}" == "integration" ]]; then
32+
SHARED_DEPS_OVERRIDE=3.45.2-SNAPSHOT
33+
fi
34+
if [ -n "${SHARED_DEPS_OVERRIDE}" ]; then
35+
echo "Account used for Artifact Registry authentication"
36+
echo "gcloud config get-value core/account:"
37+
gcloud config get-value core/account
38+
echo "wget a file from Artifact Registry:"
39+
wget --quiet --header="Authorization: Bearer $(gcloud auth print-access-token)" \
40+
--output-document=/dev/null \
41+
https://us-maven.pkg.dev/suztomo-cloud-function-test/test-maven-repo/com/google/cloud/google-cloud-shared-dependencies/3.45.2-latest-deps-2024-0418-102802/google-cloud-shared-dependencies-3.45.2-latest-deps-2024-0418-102802.pom
42+
43+
# Tell the integration tests to use the specific shared dependencies available in the snapshot repository.
44+
INTEGRATION_TEST_ARGS="${INTEGRATION_TEST_ARGS} -Dgoogle-cloud-shared-dependencies.version=${SHARED_DEPS_OVERRIDE} -Puse-snapshot-repo"
45+
echo "Showing dependency tree"
46+
mvn -B ${INTEGRATION_TEST_ARGS} -ntp dependency:tree
47+
echo "End of dependency tree"
48+
fi
49+
50+
mvn install -B -V -ntp \
51+
${INTEGRATION_TEST_ARGS} \
52+
-DskipTests=true \
53+
-Dclirr.skip=true \
54+
-Denforcer.skip=true \
55+
-Dcheckstyle.skip=true \
56+
-Dmaven.javadoc.skip=true \
57+
-Dgcloud.download.skip=true \
58+
-T 1C
59+
echo "mvn instal succeeded"
3960

4061
# if GOOGLE_APPLICATION_CREDENTIALS is specified as a relative path, prepend Kokoro root directory onto it
4162
if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then

.mvn/extensions.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
3+
<!-- Extension to allow us to use the "artifactregistry://" URL scheme -->
4+
<extension>
5+
<groupId>com.google.cloud.artifactregistry</groupId>
6+
<artifactId>artifactregistry-maven-wagon</artifactId>
7+
<version>2.2.5</version>
8+
</extension>
9+
</extensions>

pom.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,4 +214,21 @@
214214
</plugin>
215215
</plugins>
216216
</reporting>
217+
<profiles>
218+
<profile>
219+
<id>use-snapshot-repo</id>
220+
<repositories>
221+
<repository>
222+
<id>artifact-registry</id>
223+
<url>artifactregistry://us-maven.pkg.dev/suztomo-cloud-function-test/test-maven-repo-snapshot</url>
224+
<releases>
225+
<enabled>true</enabled>
226+
</releases>
227+
<snapshots>
228+
<enabled>true</enabled>
229+
</snapshots>
230+
</repository>
231+
</repositories>
232+
</profile>
233+
</profiles>
217234
</project>

0 commit comments

Comments
 (0)