Skip to content

Commit

Permalink
ci: use AOSS repository
Browse files Browse the repository at this point in the history
AOSS (https://cloud.google.com/security/products/assured-open-source-software)
provides secure OSS packages

AOSS requires to use a Kokoro custom pool. We use yoshi-ubuntu pool, where
`gcloud components install app-engine-java --quiet` failed with:

```
ERROR: (gcloud.components.install)
You cannot perform this action because the Google Cloud CLI component manager
is disabled for this installation. You can run the following command
to achieve the same result for this installation:

sudo apt-get install google-cloud-cli-app-engine-java
```

Change-Id: Id4befec68295e0207b4161476aaa966bd6ad77b6
  • Loading branch information
suztomo committed Jul 30, 2024
1 parent 6d54333 commit 343cfd6
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .kokoro/continuous.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ if [ "$EUID" -ne 0 ]
then
# not running as root
# TODO: skip unit tests because integration tests are running by maven-surefire-plugin with a unknown reason.
./mvnw clean install -V -B -U -DskipSurefire=true -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS
./mvnw clean install -V -B -U -DskipSurefire=true \
-Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS
else
# running as root - skip file permissions tests that don't work on Docker
./mvnw clean install -V -B -U -DskipSurefire=true -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS -Dtest=!FilePermissionsTest
./mvnw clean install -V -B -U -DskipSurefire=true \
-Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \
-Dtest=!FilePermissionsTest
fi
13 changes: 11 additions & 2 deletions .kokoro/stage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,26 @@ create_settings_xml_file "${MAVEN_SETTINGS_FILE}"
mkdir -p "${HOME}"/.m2
cp settings.xml "${HOME}"/.m2

gcloud components install app-engine-java --quiet
# AOSS 1P authentication verification (go/aoss1p:oss-binaries#usage-instructions)
echo "gcloud config get-value core/account:"
gcloud config get-value core/account
echo "-------- end of gcloud --------"
echo "AOSS authentication test:"
wget --header="Authorization: Bearer $(gcloud auth print-access-token)" https://us-maven.pkg.dev/cloud-aoss-1p/cloud-aoss-1p-java/log4j/log4j/1.2.17/log4j-1.2.17.pom
echo "-------- end of AOSS authentication test ------"

# gcloud components install app-engine-java --quiet
# apt-get install -y google-cloud-cli-app-engine-java

echo "Staging a release"
# stage release
./mvnw clean deploy \
-Dorg.slf4j.simpleLogger.showDateTime=true \
-Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \
--show-version \
--no-transfer-progress \
--batch-mode \
--settings "${MAVEN_SETTINGS_FILE}" \
-Paoss \
-DskipTests=true \
-DperformRelease=true \
-Dgpg.executable=gpg \
Expand Down
24 changes: 24 additions & 0 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2024 Google LLC.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<extensions>
<extension>
<groupId>com.google.cloud.artifactregistry</groupId>
<artifactId>artifactregistry-maven-wagon</artifactId>
<version>2.2.1</version>
</extension>
</extensions>
10 changes: 10 additions & 0 deletions app-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -452,5 +452,15 @@
</plugins>
</build>
</profile>
<profile>
<id>aoss</id>
<repositories>
<repository>
<id>aoss-artifact-registry</id>
<name>AOSS Repository</name>
<url>artifactregistry://us-maven.pkg.dev/cloud-aoss-1p/cloud-aoss-1p-java</url>
</repository>
</repositories>
</profile>
</profiles>
</project>
10 changes: 10 additions & 0 deletions appengine-plugins-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -559,5 +559,15 @@
</plugins>
</build>
</profile>
<profile>
<id>aoss</id>
<repositories>
<repository>
<id>aoss-artifact-registry</id>
<name>AOSS Repository</name>
<url>artifactregistry://us-maven.pkg.dev/cloud-aoss-1p/cloud-aoss-1p-java</url>
</repository>
</repositories>
</profile>
</profiles>
</project>
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
</configuration>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>com.google.cloud.artifactregistry</groupId>
<artifactId>artifactregistry-maven-wagon</artifactId>
<version>2.2.1</version>
</extension>
</extensions>
</build>

<profiles>
Expand Down

0 comments on commit 343cfd6

Please sign in to comment.