Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/CLU/clurun/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class Program
/// </summary>
/// <param name="args">The commandline arguments</param>
public static void Main(string[] args)
{
{
var debugClu = Environment.GetEnvironmentVariable("DebugCLU");
if (!String.IsNullOrEmpty(debugClu))
{
Expand Down
2 changes: 1 addition & 1 deletion src/CLU/clurun/msclu.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
RepositoryPath: C:\repos\Microsoft.CLU\artifacts\CommandPkgs\win7-x64\Debug
RepositoryPath:TOFILL
RuntimePackage: Microsoft.CLU.Commands
RuntimeVersion: 0.0.1
17 changes: 17 additions & 0 deletions tools/CLU/BuildCmdlet.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
echo off
Setlocal EnableDelayedExpansion

set DebugCLU=
set root=%~dp0..\..
if not "%1"=="" (
@powershell -file %~dp0\BuildDrop.ps1 -commandPackagesToBuild %1 --excludeCluRun
%root%\drop\clurun\win7-x64\clurun.exe --install %1
) else (
@powershell -file %~dp0\BuildDrop.ps1 -excludeCluRun
%root%\drop\clurun\win7-x64\clurun.exe --install
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Profile
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Resources
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Resources.Cmdlets
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Websites
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Management.Storage
)
7 changes: 2 additions & 5 deletions tools/CLU/BuildDrop.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ if (!($workspaceDirectory))
$env:WORKSPACE = $workspaceDirectory
}

$buildProfileScriptPath = "`"$thisScriptDirectory\BuildProfile.ps1`"" # Guard against spaces in the path
$sourcesRoot = "$workspaceDirectory\src\clu"

if (!($dropLocation))
{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i move this after the folder creating script lines, because buildprofile.ps1 appears want to ensure the folder existence.

$dropLocation = "$workspaceDirectory\drop"
Expand All @@ -24,7 +21,8 @@ if (!(Test-Path -Path $dropLocation -PathType Container))
mkdir "$dropLocation\clurun"
}


$buildProfileScriptPath = "`"$thisScriptDirectory\BuildProfile.ps1`"" # Guard against spaces in the path
$sourcesRoot = "$workspaceDirectory\src\clu"

# Grab all command packages to build.
# We'll assume that all directories that contain a *.nuspec.template file is a command package and that the name of the package is everything leading up to .nuspec.template
Expand All @@ -39,7 +37,6 @@ foreach($commandPackage in $commandPackages)
$commandPackageDir = $commandPackage.Directory
$buildOutputDirectory = Join-Path -path $commandPackageDir -ChildPath "bin\Debug\publish"


Invoke-Expression "& $buildProfileScriptPath $commandPackageDir $commandPackageName $buildOutputDirectory $packageVersion $dropLocation\CommandRepo"
}

Expand Down
48 changes: 48 additions & 0 deletions tools/CLU/SetupEnv.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
echo off

where dotnet.exe
if ERRORLEVEL 1 (
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
exit /B
)

set root=%~dp0..\..
echo Build all clu source projects
"%ProgramFiles(x86)%\MSBuild\14.0\Bin\msbuild" %root%\build.proj /t:build >NUL

if ERRORLEVEL 1 (
echo Build source project failed. To repro, run: msbuild build.proj /t:build
)

REM build cmdlets packages
@powershell -file %~dp0\BuildDrop.ps1

REM cook a msclu.cfg with a correct local repro path.
set mscluCfg=%root%\drop\clurun\win7-x64\msclu.cfg
if not exist %mscluCfg% (
copy /Y %root%\src\CLU\clurun\msclu.cfg %root%\drop\clurun\win7-x64
)
echo ^(Get-Content "%mscluCfg%"^) ^| ForEach-Object { $_ -replace "TOFILL", "%root%\drop\CommandRepo" } ^| Set-Content "%mscluCfg%"^ >"%temp%\Rep.ps1"
@powershell -file %temp%\Rep.ps1

set DebugCLU=
%root%\drop\clurun\win7-x64\clurun.exe --install
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Profile
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Resources
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Resources.Cmdlets
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Websites
%root%\drop\clurun\win7-x64\clurun.exe --install Microsoft.Azure.Commands.Management.Storage
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also add Microsoft.Azure.Commands.Resources.Cmdlets . I'm finalizing a PR to produce that package as well.

set DebugCLU=1
set Path=%Path%;%root%\drop\clurun\win7-x64

REM setup osx and linux bits which can be xcopied and run.
REM note, for known nuget bugs, skip --install by copying over cmdlet packages.
xcopy %root%\drop\clurun\win7-x64\pkgs %root%\drop\clurun\osx.10.10-x64\pkgs /S /Q /I /Y
copy /Y %root%\drop\clurun\win7-x64\azure.lx %root%\drop\clurun\osx.10.10-x64
copy /Y %root%\drop\clurun\win7-x64\msclu.cfg %root%\drop\clurun\osx.10.10-x64
copy /Y %~dp0\azure.sh %root%\drop\clurun\osx.10.10-x64

xcopy %root%\drop\clurun\win7-x64\pkgs %root%\drop\clurun\ubuntu.14.04-x64\pkgs /S /Q /I /Y
copy /Y %root%\drop\clurun\win7-x64\azure.lx %root%\drop\clurun\ubuntu.14.04-x64
copy /Y %root%\drop\clurun\win7-x64\msclu.cfg %root%\drop\clurun\ubuntu.14.04-x64
copy /Y %~dp0\azure.sh %root%\drop\clurun\ubuntu.14.04-x64
7 changes: 7 additions & 0 deletions tools/CLU/azure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
if [ -z ${CmdletSessionID} ]
then
export CmdletSessionID=$PPID
fi
SCRIPTPATH=$(dirname "$0")
$SCRIPTPATH/clurun -s azure -r $SCRIPTPATH/azure.lx $*