Skip to content

Commit 47f0601

Browse files
jkleinscbavulapati
authored andcommitted
ci: abort CI if goma authentication is invalid (electron#33413)
1 parent f00cd07 commit 47f0601

File tree

2 files changed

+29
-15
lines changed

2 files changed

+29
-15
lines changed

.circleci/build_config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,10 @@ step-setup-goma-for-build: &step-setup-goma-for-build
328328
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
329329
export GOMA_FALLBACK_ON_AUTH_FAILURE=true
330330
third_party/goma/goma_ctl.py ensure_start
331+
if [ ! -z "$RAW_GOMA_AUTH" ] && [ "`third_party/goma/goma_auth.py info`" != "Login as Fermi Planck" ]; then
332+
echo "WARNING!!!!!! Goma authentication is incorrect; please update Goma auth token."
333+
exit 1
334+
fi
331335
echo 'export GN_GOMA_FILE='`node -e "console.log(require('./src/utils/goma.js').gnFilePath)"` >> $BASH_ENV
332336
echo 'export LOCAL_GOMA_DIR='`node -e "console.log(require('./src/utils/goma.js').dir)"` >> $BASH_ENV
333337
echo 'export GOMA_FALLBACK_ON_AUTH_FAILURE=true' >> $BASH_ENV

appveyor.yml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,31 @@ build_script:
6767
- mkdir src
6868
- update_depot_tools.bat
6969
- ps: Move-Item $env:APPVEYOR_BUILD_FOLDER -Destination src\electron
70+
- ps: >-
71+
if (Test-Path 'env:RAW_GOMA_AUTH') {
72+
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
73+
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
74+
}
75+
- git clone https://github.com/electron/build-tools.git
76+
- cd build-tools
77+
- npm install
78+
- mkdir third_party
79+
- ps: >-
80+
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
81+
- ps: $env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
82+
- ps: $env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
83+
- cd ..
84+
- ps: .\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
85+
- ps: >-
86+
if (Test-Path 'env:RAW_GOMA_AUTH') {
87+
$goma_login = python $env:LOCAL_GOMA_DIR\goma_auth.py info
88+
if ($goma_login -eq 'Login as Fermi Planck') {
89+
Write-warning "Goma authentication is correct";
90+
} else {
91+
Write-warning "WARNING!!!!!! Goma authentication is incorrect; please update Goma auth token.";
92+
$host.SetShouldExit(1)
93+
}
94+
}
7095
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
7196
- ps: >-
7297
if ($env:GN_CONFIG -ne 'release') {
@@ -130,21 +155,6 @@ build_script:
130155
Write-warning "Failed to add third_party\angle\.git; continuing anyway"
131156
}
132157
}
133-
- ps: >-
134-
if (Test-Path 'env:RAW_GOMA_AUTH') {
135-
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
136-
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
137-
}
138-
- git clone https://github.com/electron/build-tools.git
139-
- cd build-tools
140-
- npm install
141-
- mkdir third_party
142-
- ps: >-
143-
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
144-
- ps: $env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
145-
- ps: $env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
146-
- cd ..
147-
- ps: .\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
148158
- cd src
149159
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
150160
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% "

0 commit comments

Comments
 (0)