build: fixup Codespaces build-tools setup (#39138)

* build: fixup Codespaces build-tools setup

* oops evm.testing1.json -> evm.testing.json
This commit is contained in:
Shelley Vohr 2023-07-18 22:58:26 +02:00 committed by GitHub
parent 139774ce48
commit 00d96970cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,6 +16,8 @@ ln -s $buildtools_configs $buildtools/configs
# Write the gclient config if it does not already exist # Write the gclient config if it does not already exist
if [ ! -f $gclient_root/.gclient ]; then if [ ! -f $gclient_root/.gclient ]; then
echo "Creating gclient config"
echo "solutions = [ echo "solutions = [
{ \"name\" : \"src/electron\", { \"name\" : \"src/electron\",
\"url\" : \"https://github.com/electron/electron\", \"url\" : \"https://github.com/electron/electron\",
@ -32,6 +34,8 @@ fi
# Write the default buildtools config file if it does # Write the default buildtools config file if it does
# not already exist # not already exist
if [ ! -f $buildtools/configs/evm.testing.json ]; then if [ ! -f $buildtools/configs/evm.testing.json ]; then
echo "Creating build-tools testing config"
write_config() { write_config() {
echo " echo "
{ {
@ -53,7 +57,7 @@ if [ ! -f $buildtools/configs/evm.testing.json ]; then
\"CHROMIUM_BUILDTOOLS_PATH\": \"/workspaces/gclient/src/buildtools\", \"CHROMIUM_BUILDTOOLS_PATH\": \"/workspaces/gclient/src/buildtools\",
\"GIT_CACHE_PATH\": \"/workspaces/gclient/.git-cache\" \"GIT_CACHE_PATH\": \"/workspaces/gclient/.git-cache\"
}, },
\"$schema\": \"file:///home/builduser/.electron_build_tools/evm-config.schema.json\" \"\$schema\": \"file:///home/builduser/.electron_build_tools/evm-config.schema.json\"
} }
" >$buildtools/configs/evm.testing.json " >$buildtools/configs/evm.testing.json
} }
@ -67,10 +71,12 @@ if [ ! -f $buildtools/configs/evm.testing.json ]; then
# if it works we can use the goma cluster # if it works we can use the goma cluster
export NOTGOMA_CODESPACES_TOKEN=$GITHUB_TOKEN export NOTGOMA_CODESPACES_TOKEN=$GITHUB_TOKEN
if e d goma_auth login; then if e d goma_auth login; then
echo "$GITHUB_USER has GOMA access - switching to cluster mode"
write_config cluster write_config cluster
fi fi
else else
# Even if the config file existed we still need to re-auth with the goma echo "build-tools testing config already exists"
# cluster
# Re-auth with the goma cluster regardless.
NOTGOMA_CODESPACES_TOKEN=$GITHUB_TOKEN e d goma_auth login || true NOTGOMA_CODESPACES_TOKEN=$GITHUB_TOKEN e d goma_auth login || true
fi fi