Skip to content

Commit 873fdd2

Browse files
committed
make build clu cmdlet package as part of CI
1 parent b1b5d6f commit 873fdd2

File tree

3 files changed

+49
-36
lines changed

3 files changed

+49
-36
lines changed

build.proj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@
182182
Dnx uses dynamic compilation, 'clean' is unnecessary -->
183183
<Target
184184
Name="Full"
185-
DependsOnTargets="Build;Test" />
185+
DependsOnTargets="Build;Test" >
186+
<Exec Command="$(LibraryToolsFolder)\CLU\BuildAndInstallClu.bat"></Exec>
187+
</Target>
186188

187189
<Target Name="BuildMsBuildTask" DependsOnTargets="RestoreNugetPackages">
188190
<MSBuild Projects="$(LibraryToolsFolder)\BuildPackagesTask\Microsoft.Azure.Build.Tasks.csproj"

tools/CLU/BuildAndInstallClu.bat

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
echo off
2+
setlocal
3+
set root=%~dp0..\..
4+
where dotnet.exe
5+
if ERRORLEVEL 1 (
6+
echo Please install 'dotnet', say from 'https://azureclu.blob.core.windows.net/tools/dotnet-win-x64.latest.zip', unzip, then add its bin folder to the PATH
7+
exit /B 1
8+
)
9+
@powershell -file %~dp0\BuildDrop.ps1
10+
11+
REM cook a msclu.cfg with a correct local repro path.
12+
set mscluCfg=%root%\drop\clurun\win7-x64\msclu.cfg
13+
if not exist %mscluCfg% (
14+
copy /Y %root%\src\CLU\clurun\msclu.cfg %root%\drop\clurun\win7-x64
15+
)
16+
echo ^(Get-Content "%mscluCfg%"^) ^| ForEach-Object { $_ -replace "TOFILL", "%root%\drop\CommandRepo" } ^| Set-Content "%mscluCfg%"^ >"%temp%\Rep.ps1"
17+
@powershell -file %temp%\Rep.ps1
18+
19+
%root%\drop\clurun\win7-x64\clurun.exe --install
20+
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Profile
21+
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Resources
22+
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Resources.Cmdlets
23+
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Websites
24+
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Management.Storage
25+
26+
REM setup osx and linux bits which can be xcopied and run.
27+
REM note, for known nuget bugs, skip --install by copying over cmdlet packages.
28+
xcopy %root%\drop\clurun\win7-x64\pkgs %root%\drop\clurun\osx.10.10-x64\pkgs /S /Q /I /Y
29+
copy /Y %root%\drop\clurun\win7-x64\azure.lx %root%\drop\clurun\osx.10.10-x64
30+
copy /Y %root%\drop\clurun\win7-x64\msclu.cfg %root%\drop\clurun\osx.10.10-x64
31+
copy /Y %~dp0\azure.sh %root%\drop\clurun\osx.10.10-x64
32+
33+
xcopy %root%\drop\clurun\win7-x64\pkgs %root%\drop\clurun\ubuntu.14.04-x64\pkgs /S /Q /I /Y
34+
copy /Y %root%\drop\clurun\win7-x64\azure.lx %root%\drop\clurun\ubuntu.14.04-x64
35+
copy /Y %root%\drop\clurun\win7-x64\msclu.cfg %root%\drop\clurun\ubuntu.14.04-x64
36+
copy /Y %~dp0\azure.sh %root%\drop\clurun\ubuntu.14.04-x64

tools/CLU/SetupEnv.bat

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,23 @@
11
echo off
2-
3-
where dotnet.exe
4-
if ERRORLEVEL 1 (
5-
echo Please install 'dotnet', say from 'https://azureclu.blob.core.windows.net/tools/dotnet-win-x64.latest.zip', unzip, then add its bin folder to the PATH
6-
exit /B
7-
)
8-
2+
setlocal
93
set root=%~dp0..\..
104
echo Build all clu source projects
115
"%ProgramFiles(x86)%\MSBuild\14.0\Bin\msbuild" %root%\build.proj /t:build >NUL
126

137
if ERRORLEVEL 1 (
148
echo Build source project failed. To repro, run: msbuild build.proj /t:build
9+
exit /B 1
1510
)
1611

1712
REM build cmdlets packages
18-
@powershell -file %~dp0\BuildDrop.ps1
19-
20-
REM cook a msclu.cfg with a correct local repro path.
21-
set mscluCfg=%root%\drop\clurun\win7-x64\msclu.cfg
22-
if not exist %mscluCfg% (
23-
copy /Y %root%\src\CLU\clurun\msclu.cfg %root%\drop\clurun\win7-x64
24-
)
25-
echo ^(Get-Content "%mscluCfg%"^) ^| ForEach-Object { $_ -replace "TOFILL", "%root%\drop\CommandRepo" } ^| Set-Content "%mscluCfg%"^ >"%temp%\Rep.ps1"
26-
@powershell -file %temp%\Rep.ps1
27-
2813
set DebugCLU=
29-
%root%\drop\clurun\win7-x64\clurun.exe --install
30-
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Profile
31-
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Resources
32-
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Resources.Cmdlets
33-
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Websites
34-
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Management.Storage
35-
set DebugCLU=1
14+
call %~dp0\BuildAndInstallClu.bat
3615
set Path=%Path%;%root%\drop\clurun\win7-x64
16+
REM run 'azure help' to verify all are wired up
17+
azure help
18+
if ERRORLEVEL 1 (
19+
echo Build and deploy clu package failed
20+
exit /B 1
21+
)
22+
set DebugCLU=1
3723

38-
REM setup osx and linux bits which can be xcopied and run.
39-
REM note, for known nuget bugs, skip --install by copying over cmdlet packages.
40-
xcopy %root%\drop\clurun\win7-x64\pkgs %root%\drop\clurun\osx.10.10-x64\pkgs /S /Q /I /Y
41-
copy /Y %root%\drop\clurun\win7-x64\azure.lx %root%\drop\clurun\osx.10.10-x64
42-
copy /Y %root%\drop\clurun\win7-x64\msclu.cfg %root%\drop\clurun\osx.10.10-x64
43-
copy /Y %~dp0\azure.sh %root%\drop\clurun\osx.10.10-x64
44-
45-
xcopy %root%\drop\clurun\win7-x64\pkgs %root%\drop\clurun\ubuntu.14.04-x64\pkgs /S /Q /I /Y
46-
copy /Y %root%\drop\clurun\win7-x64\azure.lx %root%\drop\clurun\ubuntu.14.04-x64
47-
copy /Y %root%\drop\clurun\win7-x64\msclu.cfg %root%\drop\clurun\ubuntu.14.04-x64
48-
copy /Y %~dp0\azure.sh %root%\drop\clurun\ubuntu.14.04-x64

0 commit comments

Comments
 (0)