-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[XB1] Add XB1 container for external builds (#2296)
See bug or youtube/cobalt_sandbox#513 for more context. b/266878119 Change-Id: Ib018dcd5d257c2c68cbb194f9867887ca1a4fdf6 (cherry picked from commit 7fff828)
- Loading branch information
1 parent
6948e53
commit c9bc795
Showing
4 changed files
with
93 additions
and
3 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 |
---|---|---|
@@ -1,2 +1,7 @@ | ||
<<<<<<< HEAD | ||
.\actions-runner\config.cmd --unattended --replace --url https://github.com/${env:RUNNER_REPO} --token $env:RUNNER_TOKEN --name $env:RUNNER_NAME --work $env:RUNNER_WORKDIR; | ||
.\actions-runner\run.cmd; | ||
======= | ||
C:\actions-runner\config.cmd --unattended --replace --url https://github.com/${env:RUNNER_REPO} --token $env:RUNNER_TOKEN --name $env:RUNNER_NAME --work $env:RUNNER_WORKDIR --labels $env:RUNNER_LABELS; | ||
C:\actions-runner\run.cmd; | ||
>>>>>>> 7fff8289c3c ([XB1] Add XB1 container for external builds (#2296)) |
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,50 @@ | ||
# escape=` | ||
|
||
# Copyright 2021 The Cobalt Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
ARG FROM_IMAGE | ||
FROM ${FROM_IMAGE} | ||
|
||
SHELL ["powershell", "-ExecutionPolicy", "Unrestricted", "-Command", ` | ||
"$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] | ||
|
||
# Note: Visual Studio is installed as part of cobalt-build-win-base | ||
|
||
# Windows SDK | ||
RUN Invoke-WebRequest -Uri https://go.microsoft.com/fwlink/p/?linkid=2173743 ` | ||
-OutFile C:\win_sdk_installer.exe ; ` | ||
Write-Host 'Installing win_sdk_installer.exe ...' ; ` | ||
C:\win_sdk_installer.exe /ceip off /quiet /features + | Out-Null ; ` | ||
Write-Host 'Install of win_sdk_installer.exe completed. Cleaning up ...' ; ` | ||
Remove-Item -Force -Recurse $env:TEMP\* ; ` | ||
Remove-Item C:\win_sdk_installer.exe | ||
|
||
# MSVC sdk | ||
ARG vs_buildtools_version="15" | ||
ARG windows_11_sdk_version="22000" | ||
RUN Write-Host 'Downloading vs_buildtools.exe' ; ` | ||
Invoke-WebRequest -Uri https://aka.ms/vs/${env:vs_buildtools_version}/release/vs_buildtools.exe ` | ||
-OutFile C:\vs_buildtools.exe ; ` | ||
Write-Host 'Installing vs_buildtools.exe ...' ;` | ||
Start-Process -Wait -FilePath C:\vs_buildtools.exe -ArgumentList "--quiet","--wait","--norestart","--nocache","--installPath","C:\BuildTools","--add","Microsoft.VisualStudio.Component.Windows11SDK.${env:windows_11_sdk_version}","--add","Microsoft.VisualStudio.Component.VC.Redist.14.Latest" ; ` | ||
Write-Host 'Install of vs_buildtools.exe completed. Cleaning up ...' ; ` | ||
Remove-Item C:\vs_buildtools.exe | ||
|
||
|
||
WORKDIR "C:\code" | ||
|
||
CMD python3 cobalt/build/gn.py -p $env:PLATFORM -c $env:CONFIG out/${env:PLATFORM}_${env:CONFIG};` | ||
if ($?) {` | ||
ninja $env:NINJA_FLAGS -C out/${env:PLATFORM}_$env:CONFIG $env:TARGET;` | ||
} |