ci: abort CI if goma authentication is invalid (#33413)
This commit is contained in:
parent
41f94ef154
commit
cc253f5de9
2 changed files with 29 additions and 15 deletions
|
@ -328,6 +328,10 @@ step-setup-goma-for-build: &step-setup-goma-for-build
|
||||||
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
|
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
|
||||||
export GOMA_FALLBACK_ON_AUTH_FAILURE=true
|
export GOMA_FALLBACK_ON_AUTH_FAILURE=true
|
||||||
third_party/goma/goma_ctl.py ensure_start
|
third_party/goma/goma_ctl.py ensure_start
|
||||||
|
if [ ! -z "$RAW_GOMA_AUTH" ] && [ "`third_party/goma/goma_auth.py info`" != "Login as Fermi Planck" ]; then
|
||||||
|
echo "WARNING!!!!!! Goma authentication is incorrect; please update Goma auth token."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
echo 'export GN_GOMA_FILE='`node -e "console.log(require('./src/utils/goma.js').gnFilePath)"` >> $BASH_ENV
|
echo 'export GN_GOMA_FILE='`node -e "console.log(require('./src/utils/goma.js').gnFilePath)"` >> $BASH_ENV
|
||||||
echo 'export LOCAL_GOMA_DIR='`node -e "console.log(require('./src/utils/goma.js').dir)"` >> $BASH_ENV
|
echo 'export LOCAL_GOMA_DIR='`node -e "console.log(require('./src/utils/goma.js').dir)"` >> $BASH_ENV
|
||||||
echo 'export GOMA_FALLBACK_ON_AUTH_FAILURE=true' >> $BASH_ENV
|
echo 'export GOMA_FALLBACK_ON_AUTH_FAILURE=true' >> $BASH_ENV
|
||||||
|
|
40
appveyor.yml
40
appveyor.yml
|
@ -67,6 +67,31 @@ build_script:
|
||||||
- mkdir src
|
- mkdir src
|
||||||
- update_depot_tools.bat
|
- update_depot_tools.bat
|
||||||
- ps: Move-Item $env:APPVEYOR_BUILD_FOLDER -Destination src\electron
|
- ps: Move-Item $env:APPVEYOR_BUILD_FOLDER -Destination src\electron
|
||||||
|
- ps: >-
|
||||||
|
if (Test-Path 'env:RAW_GOMA_AUTH') {
|
||||||
|
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
|
||||||
|
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
|
||||||
|
}
|
||||||
|
- git clone https://github.com/electron/build-tools.git
|
||||||
|
- cd build-tools
|
||||||
|
- npm install
|
||||||
|
- mkdir third_party
|
||||||
|
- ps: >-
|
||||||
|
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
|
||||||
|
- ps: $env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
|
||||||
|
- ps: $env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
|
||||||
|
- cd ..
|
||||||
|
- ps: .\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
|
||||||
|
- ps: >-
|
||||||
|
if (Test-Path 'env:RAW_GOMA_AUTH') {
|
||||||
|
$goma_login = python $env:LOCAL_GOMA_DIR\goma_auth.py info
|
||||||
|
if ($goma_login -eq 'Login as Fermi Planck') {
|
||||||
|
Write-warning "Goma authentication is correct";
|
||||||
|
} else {
|
||||||
|
Write-warning "WARNING!!!!!! Goma authentication is incorrect; please update Goma auth token.";
|
||||||
|
$host.SetShouldExit(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
|
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
|
||||||
- ps: >-
|
- ps: >-
|
||||||
if ($env:GN_CONFIG -ne 'release') {
|
if ($env:GN_CONFIG -ne 'release') {
|
||||||
|
@ -130,21 +155,6 @@ build_script:
|
||||||
Write-warning "Failed to add third_party\angle\.git; continuing anyway"
|
Write-warning "Failed to add third_party\angle\.git; continuing anyway"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
- ps: >-
|
|
||||||
if (Test-Path 'env:RAW_GOMA_AUTH') {
|
|
||||||
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
|
|
||||||
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
|
|
||||||
}
|
|
||||||
- git clone https://github.com/electron/build-tools.git
|
|
||||||
- cd build-tools
|
|
||||||
- npm install
|
|
||||||
- mkdir third_party
|
|
||||||
- ps: >-
|
|
||||||
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
|
|
||||||
- ps: $env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
|
|
||||||
- ps: $env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
|
|
||||||
- cd ..
|
|
||||||
- ps: .\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
|
|
||||||
- cd src
|
- cd src
|
||||||
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
|
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
|
||||||
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% "
|
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% "
|
||||||
|
|
Loading…
Reference in a new issue