Skip to content

Commit

Permalink
Add a maven/configure-mirror pipeline to redirect to GCP.
Browse files Browse the repository at this point in the history
We've seen some slowness and flakiness on GCP runners when
hitting maven central. Configuring this is tricky, so I made a pipeline.

Signed-off-by: Dan Lorenc <dlorenc@chainguard.dev>
  • Loading branch information
dlorenc committed Sep 1, 2023
1 parent ec726bf commit 68faa72
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pkg/build/pipelines/maven/configure-mirror.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Configure GCP Maven Central mirror for faster downloads
needs:
packages:
- busybox
pipeline:
runs: |
# Maven checks $USER/.m2, we set $HOME to /home/build but it hardcodes $USER somehow
mkdir -p /root/.m2
cat > /root/.m2/settings.xml <<EOF
<settings>
<mirrors>
<mirror>
<id>google-maven-central</id>
<name>GCS Maven Central mirror</name>
<url>https://maven-central.storage-download.googleapis.com/maven2/</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
</settings>
EOF

0 comments on commit 68faa72

Please sign in to comment.