Skip to content

Commit

Permalink
Add script to publish current version
Browse files Browse the repository at this point in the history
  • Loading branch information
andreashuber-lawo committed Oct 6, 2015
1 parent 9ad3e4b commit c108c1e
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions Publish.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
$ErrorActionPreference = "Stop"
"Build and Publish Ember+ Sharp"

# Delete existing package
$packageName = "EmberPlusSharp_Windows_AnyCpu_Release.zip"
$password = Read-Host 'cimaster Password'
echo open cimaster.lawo.de >temp.ftp
echo cimaster >>temp.ftp
echo $password >>temp.ftp
echo cd /var/www/ember-plus-sharp/trunk/bin >>temp.ftp
echo del $packageName >>temp.ftp
echo quit >>temp.ftp
ftp -s:temp.ftp
del temp.ftp

$packageDirectory = [IO.Path]::Combine([IO.Path]::GetTempPath(), [IO.Path]::GetRandomFileName())
[void][IO.Directory]::CreateDirectory($packageDirectory)
$packagePath = [IO.Path]::Combine($packageDirectory, $packageName)
$requestPath = "http://cimaster.lawo.de/ember-plus-sharp/trunk/bin/" + $packageName

# Make sure package is no longer present
try
{
Invoke-WebRequest $requestPath -OutFile $packagePath
"FATAL: Package deletion failed."
exit
}
catch
{
}

# Start Build
[void](Invoke-WebRequest "http://cimaster.lawo.de:8080/job/EmberPlusSharp_Windows_AnyCpu_Release/build?token=B497D548-5260-49C0-8932-5A40187E7866")

# Download package as soon as it's available
$downloadSucceeded = $false

while (!$downloadSucceeded)
{
try
{
Invoke-WebRequest $requestPath -OutFile $packagePath
$downloadSucceeded = $true
}
catch
{
Start-Sleep -Seconds 10
}
}

7z x "$packagePath" -o"$packageDirectory"

0 comments on commit c108c1e

Please sign in to comment.