-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to publish current version
- Loading branch information
1 parent
9ad3e4b
commit c108c1e
Showing
1 changed file
with
51 additions
and
0 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
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" |