-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
_scripts/cacheWarm: warm the CUE dependency cache
This adds a script that warms the CUE dependency cache, using credentials for the central registry passed in via the CUELANG_CUE_LOGINS environment variable. This is primarily to solve the problem of CUE needing access to these CUE dependencies during the Netlify build stage that's executed by production deployments, tip deployments, and PR previews. The trybot CI workflow is updated to call this script directly, as the logic is identical but the sequencing is different (CI needs the cache warmed sooner than the build.bash script is invoked). Signed-off-by: Jonathan Matthews <[email protected]> Change-Id: I63dacf1fe0f250a72750a9f3886ff8fb61436671 Dispatch-Trailer: {"type":"trybot","CL":1203266,"patchset":4,"ref":"refs/changes/66/1203266/4","targetBranch":"master"}
- Loading branch information
1 parent
0fb54c0
commit e9625f5
Showing
4 changed files
with
28 additions
and
14 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
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,13 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
# warmCache.bash warms the CUE module cache with any CUE dependencies, so that | ||
# any credentials used to authenticate to the central registry only need to be | ||
# in scope for the duration of this script. | ||
|
||
function cleanup() { rm -rfv "${CUE_CONFIG_DIR}"; } | ||
|
||
export CUE_CONFIG_DIR="$(mktemp -d)" | ||
trap cleanup EXIT | ||
echo "$CUELANG_CUE_LOGINS" >"$CUE_CONFIG_DIR/logins.json" | ||
go run cuelang.org/go/cmd/cue mod tidy --check |
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