Skip to content

Commit 4d64505

Browse files
ci(spanner): use airlock for presubmit jobs
1 parent 705b627 commit 4d64505

File tree

15 files changed

+174
-4
lines changed

15 files changed

+174
-4
lines changed

.kokoro/build.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
set -eo pipefail
1717

18+
set -x
19+
1820
## Get the directory of the build script
1921
scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
2022
## cd to the parent directory, i.e. the root of the git repo
@@ -33,9 +35,15 @@ fi
3335
mvn -version
3436
echo ${JOB_TYPE}
3537

38+
INSTALL_OPTS=""
39+
if [[ $ENABLE_AIRLOCK = 'true' ]]; then
40+
INSTALL_OPTS="-Pairlock-trusted"
41+
fi
42+
3643
# attempt to install 3 times with exponential backoff (starting with 10 seconds)
3744
retry_with_backoff 3 10 \
38-
mvn install -B -V -ntp \
45+
mvn install -B -V \
46+
${INSTALL_OPTS} \
3947
-DskipTests=true \
4048
-Dclirr.skip=true \
4149
-Denforcer.skip=true \

.kokoro/dependencies.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
set -eo pipefail
1717
shopt -s nullglob
1818

19+
set -x
20+
1921
## Get the directory of the build script
2022
scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
2123
## cd to the parent directory, i.e. the root of the git repo
@@ -53,9 +55,21 @@ if [ ! -z "${JAVA11_HOME}" ]; then
5355
setJava "${JAVA11_HOME}"
5456
fi
5557

58+
INSTALL_OPTS=""
59+
if [[ $ENABLE_AIRLOCK = 'true' ]]; then
60+
INSTALL_OPTS="-Pairlock-trusted"
61+
wget -q https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -O /tmp/maven.zip && \
62+
unzip /tmp/maven.zip -d /tmp/maven && \
63+
rm -r /usr/local/lib/maven && \
64+
mv /tmp/maven/apache-maven-3.9.9 /usr/local/lib/maven && \
65+
rm /tmp/maven.zip && \
66+
ls -la /usr/local/lib/maven
67+
fi
68+
5669
# this should run maven enforcer
5770
retry_with_backoff 3 10 \
58-
mvn install -B -V -ntp \
71+
mvn install -U -B -V \
72+
${INSTALL_OPTS} \
5973
-DskipTests=true \
6074
-Dmaven.javadoc.skip=true \
6175
-Dclirr.skip=true
@@ -64,4 +78,4 @@ if [ ! -z "${JAVA8_HOME}" ]; then
6478
setJava "${JAVA8_HOME}"
6579
fi
6680

67-
mvn -B dependency:analyze -DfailOnWarning=true
81+
mvn -B ${INSTALL_OPTS} dependency:analyze -DfailOnWarning=true

.kokoro/presubmit/dependencies.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@ env_vars: {
1010
key: "TRAMPOLINE_BUILD_FILE"
1111
value: "github/java-spanner/.kokoro/dependencies.sh"
1212
}
13+
14+
env_vars: {
15+
key: "ENABLE_AIRLOCK",
16+
value: "true"
17+
}

.mvn/extensions.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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>
4+
<groupId>com.google.cloud.artifactregistry</groupId>
5+
<artifactId>artifactregistry-maven-wagon</artifactId>
6+
<version>2.2.3</version>
7+
</extension>
8+
</extensions>

google-cloud-spanner-executor/pom.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@
4747
<artifactId>exporter-trace</artifactId>
4848
<version>0.33.0</version>
4949
</dependency>
50+
<dependency>
51+
<groupId>com.google.cloud.opentelemetry</groupId>
52+
<artifactId>shared-resourcemapping</artifactId>
53+
<version>0.33.0</version>
54+
</dependency>
5055
<dependency>
5156
<groupId>com.google.cloud</groupId>
5257
<artifactId>google-cloud-spanner</artifactId>
@@ -200,7 +205,9 @@
200205
<build>
201206
<plugins>
202207
<plugin>
208+
<groupId>org.apache.maven.plugins</groupId>
203209
<artifactId>maven-resources-plugin</artifactId>
210+
<version>3.3.1</version>
204211
<executions>
205212
<execution>
206213
<id>copy-resources</id>
@@ -266,7 +273,7 @@
266273
<groupId>org.apache.maven.plugins</groupId>
267274
<artifactId>maven-dependency-plugin</artifactId>
268275
<configuration>
269-
<ignoredDependencies> com.google.api:gax,org.apache.maven.surefire:surefire-junit4 </ignoredDependencies>
276+
<ignoredDependencies> com.google.api:gax,org.apache.maven.surefire:surefire-junit4,com.google.cloud.opentelemetry:shared-resourcemapping</ignoredDependencies>
270277
</configuration>
271278
</plugin>
272279
</plugins>

google-cloud-spanner/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
<plugin>
119119
<groupId>org.graalvm.buildtools</groupId>
120120
<artifactId>native-maven-plugin</artifactId>
121+
<version>0.10.4</version>
121122
<configuration>
122123
<buildArgs combine.children="append">
123124
<buildArg>-Dspanner.testenv.config.class=${spanner.testenv.config.class}</buildArg>
@@ -133,6 +134,7 @@
133134
<?m2e ignore?>
134135
<groupId>org.codehaus.mojo</groupId>
135136
<artifactId>flatten-maven-plugin</artifactId>
137+
<version>1.6.0</version>
136138
</plugin>
137139

138140
<plugin>

grpc-google-cloud-spanner-admin-database-v1/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
<?m2e ignore?>
8484
<groupId>org.codehaus.mojo</groupId>
8585
<artifactId>flatten-maven-plugin</artifactId>
86+
<version>1.6.0</version>
8687
</plugin>
8788
</plugins>
8889
</build>

grpc-google-cloud-spanner-admin-instance-v1/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
<?m2e ignore?>
8484
<groupId>org.codehaus.mojo</groupId>
8585
<artifactId>flatten-maven-plugin</artifactId>
86+
<version>1.6.0</version>
8687
</plugin>
8788
</plugins>
8889
</build>

grpc-google-cloud-spanner-executor-v1/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
<?m2e ignore?>
7676
<groupId>org.codehaus.mojo</groupId>
7777
<artifactId>flatten-maven-plugin</artifactId>
78+
<version>1.6.0</version>
7879
</plugin>
7980
</plugins>
8081
</build>

grpc-google-cloud-spanner-v1/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
<?m2e ignore?>
7676
<groupId>org.codehaus.mojo</groupId>
7777
<artifactId>flatten-maven-plugin</artifactId>
78+
<version>1.6.0</version>
7879
</plugin>
7980
</plugins>
8081
</build>

0 commit comments

Comments
 (0)