Skip to content

Commit

Permalink
Refine publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
andreashuber-lawo committed Oct 8, 2015
1 parent 6c97727 commit a1468c8
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Lawo.EmberPlusDoc/Content/Welcome.aml
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@
<listItem>
<para>
<externalLink>
<linkText>Assemblies, Tools and Documentation</linkText>
<linkText>v0.0.0.1 Release</linkText>
<linkUri>https://github.com/Lawo/ember-plus-sharp/releases/tag/v0.0.0.1</linkUri>
</externalLink>
</para>
</listItem>
<listItem>
<para>
<externalLink>
<linkText>Source Code</linkText>
<linkUri>https://github.com/Lawo/ember-plus-sharp/archive/v0.0.0.1.zip</linkUri>
<linkText>Latest Release</linkText>
<linkUri>https://github.com/Lawo/ember-plus-sharp/releases</linkUri>
</externalLink>
</para>
</listItem>
Expand Down
42 changes: 40 additions & 2 deletions Publish.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ echo quit >>temp.ftp
ftp -s:temp.ftp
del temp.ftp

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

# Make sure package is no longer present
Expand All @@ -27,9 +28,11 @@ try
}
catch
{
"The current package has been deleted successfully."
}

# Start Build
"Starting 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
Expand All @@ -41,11 +44,46 @@ while (!$downloadSucceeded)
{
Invoke-WebRequest $requestPath -OutFile $packagePath
$downloadSucceeded = $true
"The new package has been downloaded successfully."
}
catch
{
"Waiting for the build to finish..."
Start-Sleep -Seconds 10
}
}

"Extracting package..."
7z x "$packagePath" -o"$packageDirectory"
$version = [Reflection.Assembly]::Loadfile([IO.Path]::Combine($packageDirectory, "GlowAnalyzerProxy.exe")).GetName().Version.ToString()
"Package version is " + $version + "."
$extension = [IO.Path]::GetExtension($packageName)
$newPackageName = $packageName.Replace($extension, "-" + $version + $extension)
Rename-Item $packagePath $newPackageName

"Cloning gh-pages..."
$ghpagesDirectory = [IO.Path]::Combine($tempDirectory, [IO.Path]::GetRandomFileName())
git clone -q --branch gh-pages "https://github.com/Lawo/ember-plus-sharp.git" "$ghpagesDirectory"
cd $ghpagesDirectory

"Removing current documentation..."
Remove-Item * -Recurse -Exclude .git

"Adding new documentation..."
$documentationPattern = [IO.Path]::Combine($packageDirectory, "Help", "*.*")
xcopy $documentationPattern . /e /q
git add -A

"Committing documentation changes..."
$tag = "v" + $version
$message = "Publish " + $tag + " documentation."
git commit -m $message

"Setting tag on master branch..."
git checkout -q master
git tag $tag

"Pushing everything..."
# git push --all origin

cd ..

0 comments on commit a1468c8

Please sign in to comment.