Skip to content

Commit 6dfced4

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

File tree

13 files changed

+164
-3
lines changed

13 files changed

+164
-3
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>

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>

pom.xml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@
163163
<showDeprecation>true</showDeprecation>
164164
</configuration>
165165
</plugin>
166+
<plugin>
167+
<groupId>org.apache.maven.plugins</groupId>
168+
<artifactId>maven-resources-plugin</artifactId>
169+
<version>3.2.0</version>
170+
</plugin>
166171
</plugins>
167172
</build>
168173

@@ -234,4 +239,117 @@
234239
</plugin>
235240
</plugins>
236241
</reporting>
242+
243+
<profiles>
244+
<profile>
245+
<!-- Profile to use Airlock (go/airlock/howto_maven). Disabled by default. -->
246+
<id>airlock-trusted</id>
247+
<pluginRepositories>
248+
<pluginRepository>
249+
<id>airlock</id>
250+
<name>Airlock</name>
251+
<url>artifactregistry://us-maven.pkg.dev/artifact-foundry-prod/maven-3p-trusted</url>
252+
<layout>default</layout>
253+
<releases>
254+
<enabled>true</enabled>
255+
</releases>
256+
<snapshots>
257+
<enabled>true</enabled>
258+
</snapshots>
259+
</pluginRepository>
260+
<!-- Adding a fallback to airlock 3p staging till all the license verification issues are resolved -->
261+
<pluginRepository>
262+
<id>airlock-staging</id>
263+
<name>Airlock</name>
264+
<url>artifactregistry://us-maven.pkg.dev/artifact-foundry-prod/ah-3p-staging-maven</url>
265+
<layout>default</layout>
266+
<releases>
267+
<enabled>true</enabled>
268+
</releases>
269+
<snapshots>
270+
<enabled>true</enabled>
271+
</snapshots>
272+
</pluginRepository>
273+
<pluginRepository>
274+
<id>central</id>
275+
<!-- Disable default Maven Central -->
276+
<name>Maven Central remote repository</name>
277+
<url>https://repo.maven.apache.org/maven2</url>
278+
<layout>default</layout>
279+
<releases>
280+
<enabled>false</enabled>
281+
</releases>
282+
<snapshots>
283+
<enabled>false</enabled>
284+
</snapshots>
285+
</pluginRepository>
286+
<pluginRepository>
287+
<id>rso-public-grid</id>
288+
<!-- Disable default sonatype public grid -->
289+
<name>Maven Central Sonatype repository</name>
290+
<url>https://repository.sonatype.org/content/groups/sonatype-public-grid</url>
291+
<layout>default</layout>
292+
<releases>
293+
<enabled>false</enabled>
294+
</releases>
295+
<snapshots>
296+
<enabled>false</enabled>
297+
</snapshots>
298+
</pluginRepository>
299+
</pluginRepositories>
300+
<repositories>
301+
<repository>
302+
<id>airlock</id>
303+
<name>Airlock</name>
304+
<url>artifactregistry://us-maven.pkg.dev/artifact-foundry-prod/maven-3p-trusted</url>
305+
<layout>default</layout>
306+
<releases>
307+
<enabled>true</enabled>
308+
</releases>
309+
<snapshots>
310+
<enabled>true</enabled>
311+
</snapshots>
312+
</repository>
313+
<!-- Adding a fallback to airlock 3p staging till all the license verification issues are resolved -->
314+
<repository>
315+
<id>airlock-staging</id>
316+
<name>Airlock</name>
317+
<url>artifactregistry://us-maven.pkg.dev/artifact-foundry-prod/ah-3p-staging-maven</url>
318+
<layout>default</layout>
319+
<releases>
320+
<enabled>true</enabled>
321+
</releases>
322+
<snapshots>
323+
<enabled>true</enabled>
324+
</snapshots>
325+
</repository>
326+
<repository>
327+
<id>central</id>
328+
<!-- Disable default Maven Central -->
329+
<name>Maven Central remote repository</name>
330+
<url>https://repo.maven.apache.org/maven2</url>
331+
<layout>default</layout>
332+
<releases>
333+
<enabled>false</enabled>
334+
</releases>
335+
<snapshots>
336+
<enabled>false</enabled>
337+
</snapshots>
338+
</repository>
339+
<repository>
340+
<id>rso-public-grid</id>
341+
<!-- Disable default sonatype public grid -->
342+
<name>Maven Central Sonatype repository</name>
343+
<url>https://repository.sonatype.org/content/groups/sonatype-public-grid</url>
344+
<layout>default</layout>
345+
<releases>
346+
<enabled>false</enabled>
347+
</releases>
348+
<snapshots>
349+
<enabled>false</enabled>
350+
</snapshots>
351+
</repository>
352+
</repositories>
353+
</profile>
354+
</profiles>
237355
</project>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<?m2e ignore?>
4242
<groupId>org.codehaus.mojo</groupId>
4343
<artifactId>flatten-maven-plugin</artifactId>
44+
<version>1.6.0</version>
4445
</plugin>
4546
</plugins>
4647
</build>

0 commit comments

Comments
 (0)