Skip to content

Commit

Permalink
Creating packages for scoop
Browse files Browse the repository at this point in the history
  • Loading branch information
manojlds committed Nov 5, 2013
1 parent 8beabca commit d429bc9
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
artifacts/
build/
*.nupkg
4 changes: 4 additions & 0 deletions Scoop/scoopInstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$script:scriptDir = split-path $MyInvocation.MyCommand.Path -parent

write-host -fore green "YDeliver installed. Import the module by running:"
write-host -fore yellow "Import-Module $scriptDir\Ydeliver.psm1"
4 changes: 2 additions & 2 deletions YBuild/Tasks/NugetPackage.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
task NugetPackage {
$buildPath, $libPath, $buildMode = Get-Conventions buildPath, libPath, buildMode
$buildPath, $artifactsDir, $libPath, $buildMode = Get-Conventions buildPath, artifactsDir, libPath, buildMode
$nuget = "$libPath\Nuget\Nuget.exe"
$basePath = $buildPath
if($config["nugetBasePath"]){
Expand All @@ -10,7 +10,7 @@ task NugetPackage {
$project = Get-ChildItem "$rootDir\$_" -recurse

Exec {
& $nuget pack $project -BasePath $basePath -Version $buildVersion -OutputDirectory $buildPath -Properties Configuration=$buildMode
& $nuget pack $project -BasePath $basePath -Version $buildVersion -OutputDirectory $artifactsDir -Properties Configuration=$buildMode
} "Nuget packaging failed"
}
}
7 changes: 3 additions & 4 deletions YBuild/Tasks/Package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function Write-PackageHelp {
}

task Package {
$buildPath = Get-Conventions buildPath
$buildPath, $artifactsDir = Get-Conventions buildPath, artifactsDir

if ($config.copyContents.keys) {
($config.copyContents).keys | %{
Expand All @@ -20,8 +20,7 @@ task Package {
if ($config.packageContents.keys) {
($config.packageContents).keys | %{
$source = Resolve-PathExpanded $_
Write-Zip $source $buildPath $config.packageContents[$_]
Write-Zip $source $artifactsDir $config.packageContents[$_]
}
}

}
}
15 changes: 15 additions & 0 deletions YBuild/Tasks/ScoopPackage.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
task ScoopPackage {
$buildPath, $artifactsDir = Get-Conventions buildPath, artifactsDir

$manifestFile = Resolve-PathExpanded $config.scoop.manifestFile
$package = Join-Path $artifactsDir $config.scoop.package

$md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
$hash = [System.BitConverter]::ToString($md5.ComputeHash([System.IO.File]::ReadAllBytes($package)))

$manifestJson = @{
version= $buildVersion;
hash= "md5:$hash";
}

}
12 changes: 12 additions & 0 deletions build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,16 @@ copyContents:
"$rootDir/YScaffold": "$buildPath/tools"
"$rootDir/YDeliver.psm1": "$buildPath/tools"

packageContents:
"$buildPath/tools/*": "YDeliver.zip"
"$rootDir/Scoop/scoopInstall.ps1": "YDeliver.zip"

scoop:
manifest:
url: "http://localhost:8000/YDeliver.zip"
homepage: "http://ydeliver.stacktoheap.com"
installer: "scoopInstall.ps1"
package: "YDeliver.zip"


nugetSpecs: [ydeliver.nuspec]
3 changes: 0 additions & 3 deletions install.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
conventions:
artifactsDir: "$rootDir/build"

install:
ydeliver:
tasks:
Expand Down

0 comments on commit d429bc9

Please sign in to comment.