-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(interop): only write to cache if we have credentials
For pull-requests coming from forks, we don't have access to the secrets. This is currently failing CI for all PRs from forks as docker cannot write the cache after running the tests. Pull-Request: #4604.
- Loading branch information
1 parent
77149f0
commit 35b8308
Showing
2 changed files
with
20 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# This uses the same S3 cache as all test-plans images. Because we use `cargo-chef` in the Dockerfile, we have a layer available with all dependencies built. | ||
|
||
CACHE_TO="" | ||
|
||
# If we have credentials, write to cache | ||
if [[ -n "${AWS_SECRET_ACCESS_KEY}" ]]; then | ||
CACHE_TO="--cache-to type=s3,mode=max,bucket=libp2p-by-tf-aws-bootstrap,region=us-east-1,prefix=buildCache,name=${FLAVOUR}-rust-libp2p-head" | ||
fi | ||
|
||
docker buildx build \ | ||
--load \ | ||
$CACHE_TO \ | ||
--cache-from type=s3,mode=max,bucket=libp2p-by-tf-aws-bootstrap,region=us-east-1,prefix=buildCache,name=${FLAVOUR}-rust-libp2p-head \ | ||
-t ${FLAVOUR}-rust-libp2p-head \ | ||
. \ | ||
-f interop-tests/Dockerfile.${FLAVOUR} |