From 74e33080174cd29d3c9f9ed4a499b30fe129ae34 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Fri, 22 Sep 2017 16:52:04 +0200 Subject: [PATCH] Adds Azure Gallery release script - no more need for WebPI builds --- .../Modules/Umbraco.Build/Umbraco.Build.psm1 | 19 --- build/azuregalleryrelease.ps1 | 59 +++++++ src/WebPi/TBEX.xml | 76 --------- src/WebPi/installSQL1.sql | 9 - src/WebPi/installSQL2.sql | 15 -- src/WebPi/manifest.xml | 45 ----- src/WebPi/parameters.xml | 161 ------------------ src/WebPi/umbraco/favicon.ico | Bin 15934 -> 0 bytes 8 files changed, 59 insertions(+), 325 deletions(-) create mode 100644 build/azuregalleryrelease.ps1 delete mode 100644 src/WebPi/TBEX.xml delete mode 100644 src/WebPi/installSQL1.sql delete mode 100644 src/WebPi/installSQL2.sql delete mode 100644 src/WebPi/manifest.xml delete mode 100644 src/WebPi/parameters.xml delete mode 100644 src/WebPi/umbraco/favicon.ico diff --git a/build/Modules/Umbraco.Build/Umbraco.Build.psm1 b/build/Modules/Umbraco.Build/Umbraco.Build.psm1 index 67079aa330..2c9c38d41f 100644 --- a/build/Modules/Umbraco.Build/Umbraco.Build.psm1 +++ b/build/Modules/Umbraco.Build/Umbraco.Build.psm1 @@ -377,14 +377,6 @@ function Prepare-Packages Copy-Files "$src\Umbraco.Web.UI\umbraco\lib" "*" "$tmp\WebApp\umbraco\lib" Copy-Files "$src\Umbraco.Web.UI\umbraco\views" "*" "$tmp\WebApp\umbraco\views" Copy-Files "$src\Umbraco.Web.UI\umbraco\preview" "*" "$tmp\WebApp\umbraco\preview" - - # prepare WebPI - Write-Host "Prepare WebPI" - Remove-Directory "$tmp\WebPi" - mkdir "$tmp\WebPi" > $null - mkdir "$tmp\WebPi\umbraco" > $null - Copy-Files "$tmp\WebApp" "*" "$tmp\WebPi\umbraco" - Copy-Files "$src\WebPi" "*" "$tmp\WebPi" } # @@ -413,17 +405,6 @@ function Package-Zip "$tmp\WebApp\*" ` "-x!dotless.Core.*" "-x!Content_Types.xml" "-x!*.pdb"` > $null - - Write-Host "Zip WebPI" - &$uenv.Zip a -r "$out\UmbracoCms.WebPI.$($version.Semver).zip" "-x!*.pdb"` - "$tmp\WebPi\*" ` - "-x!dotless.Core.*" ` - > $null - - # hash the webpi file - Write-Host "Hash WebPI" - $hash = Get-FileHash "$out\UmbracoCms.WebPI.$($version.Semver).zip" - Write $hash | out-file "$out\webpihash.txt" -encoding ascii } # diff --git a/build/azuregalleryrelease.ps1 b/build/azuregalleryrelease.ps1 new file mode 100644 index 0000000000..502ca3010e --- /dev/null +++ b/build/azuregalleryrelease.ps1 @@ -0,0 +1,59 @@ +Param( + [string]$GitHubPersonalAccessToken, + [string]$Directory +) +$workingDirectory = $Directory +CD $workingDirectory + +# Clone repo +$fullGitUrl = "https://$env:GIT_URL/$env:GIT_REPOSITORYNAME.git" +git clone $fullGitUrl 2>&1 | % { $_.ToString() } + +# Remove everything so that unzipping the release later will update everything +# Don't remove the readme file nor the git directory +Write-Host "Cleaning up git directory before adding new version" +Remove-Item -Recurse $workingDirectory\$env:GIT_REPOSITORYNAME\* -Exclude README.md,.git + +# Find release zip +$zipsDir = "$workingDirectory\$env:BUILD_DEFINITIONNAME\zips" +$pattern = "UmbracoCms.([0-9]{1,2}.[0-9]{1,3}.[0-9]{1,3}).zip" +Write-Host "Searching for Umbraco release files in $workingDirectory\$zipsDir for a file with pattern $pattern" +$file = (Get-ChildItem $zipsDir | Where-Object { $_.Name -match "$pattern" }) + +if($file) +{ + # Get release name + $version = [regex]::Match($file.Name, $pattern).captures.groups[1].value + $releaseName = "Umbraco $version" + Write-Host "Found $releaseName" + + # Unzip into repository to update release + Add-Type -AssemblyName System.IO.Compression.FileSystem + Write-Host "Unzipping $($file.FullName) to $workingDirectory\$env:GIT_REPOSITORYNAME" + [System.IO.Compression.ZipFile]::ExtractToDirectory("$($file.FullName)", "$workingDirectory\$env:GIT_REPOSITORYNAME") + + # Telling git who we are + git config --global user.email "coffee@umbraco.com" 2>&1 | % { $_.ToString() } + git config --global user.name "Umbraco HQ" 2>&1 | % { $_.ToString() } + + # Commit + CD $env:GIT_REPOSITORYNAME + Write-Host "Committing Umbraco $version Release from Build Output" + + git add . 2>&1 | % { $_.ToString() } + git commit -m " Release $releaseName from Build Output" 2>&1 | % { $_.ToString() } + + # Tag the release + git tag -a "v$version" -m "v$version" + + # Push release to master + $fullGitAuthUrl = "https://$($env:GIT_USERNAME):$GitHubPersonalAccessToken@$env:GIT_URL/$env:GIT_REPOSITORYNAME.git" + git push $fullGitAuthUrl 2>&1 | % { $_.ToString() } + + #Push tag to master + git push $fullGitAuthUrl --tags 2>&1 | % { $_.ToString() } +} +else +{ + Write-Error "Umbraco release file not found, searched in $workingDirectory\$zipsDir for a file with pattern $pattern - cancelling" +} diff --git a/src/WebPi/TBEX.xml b/src/WebPi/TBEX.xml deleted file mode 100644 index 827bd01574..0000000000 --- a/src/WebPi/TBEX.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Start Here - First time here? Complete the installation of your Umbraco Site, select a Starter Kit and Skin to get you started. - /install/default.aspx - http://cdn.umbraco.org/cdn/umbraco/images/webmatrix/umbraco.png - - - Getting Started with Umbraco - So you've finished installing Umbraco in WebMatrix, what next? Learn how to build and configure your new site! - http://our.umbraco.org/wiki/how-tos/getting-started-with-umbraco-what-is-next-after-you-install - http://cdn.umbraco.org/cdn/umbraco/images/webmatrix/umbraco.png - - - Extending Umbraco using WebMatrix - In this 5-minute video tutorial you'll learn how to edit templates, use the Razor syntax to add dynamic functionality and deploy an Umbraco site - all from within WebMatrix. - http://umbraco.com/help-and-support/video-tutorials/getting-started/working-with-webmatrix - http://cdn.umbraco.org/cdn/umbraco/images/webmatrix/umbraco.png - - - Umbraco Forum - Where the friendliest CMS community on the planet helps each other - Search for documentation, get help and guidance from seasoned experts, download and collaborate on plugins and extensions. - http://our.umbraco.org/ - http://cdn.umbraco.org/cdn/umbraco/images/webmatrix/community.png - - - Umbraco Products - We have additional products and services available to help you get the most out of Umbraco. - http://umbraco.com/products - http://umbraco.com/products - http://cdn.umbraco.org/cdn/umbraco/images/webmatrix/products.png - - - Umbraco Community Projects - "The Deli" - Find free and commercial add-ons, extensions, skins, and starter sites. - http://our.umbraco.org/projects - http://cdn.umbraco.org/cdn/umbraco/images/webmatrix/deli.png - - - - - - -/umbraco/ -http://cdn.umbraco.org/cdn/umbraco/images/webmatrix/umbraco.png - - - - -http://our.umbraco.org/ -http://cdn.umbraco.org/cdn/umbraco/images/webmatrix/community.png - - - - - - - install - - - web.config - - - bin - - - umbraco - - - umbraco_client - - - - diff --git a/src/WebPi/installSQL1.sql b/src/WebPi/installSQL1.sql deleted file mode 100644 index 8abdf52c43..0000000000 --- a/src/WebPi/installSQL1.sql +++ /dev/null @@ -1,9 +0,0 @@ -/**********************************************************************/ -/* Install.SQL */ -/* Creates a login and makes the user a member of db roles */ -/* */ -/* Modifications for SQL AZURE - ON MASTER */ -/**********************************************************************/ - - -CREATE LOGIN PlaceHolderForUser WITH PASSWORD = 'PlaceHolderForPassword' \ No newline at end of file diff --git a/src/WebPi/installSQL2.sql b/src/WebPi/installSQL2.sql deleted file mode 100644 index 653d7d4fbf..0000000000 --- a/src/WebPi/installSQL2.sql +++ /dev/null @@ -1,15 +0,0 @@ -/**********************************************************************/ -/* CreateUser.SQL */ -/* Creates a user and makes the user a member of db roles */ -/* This script runs against the User database and requires connection string */ -/* Supports SQL Server and SQL AZURE */ -/**********************************************************************/ - --- Create database user and map to login --- and add user to the datareader, datawriter, ddladmin and securityadmin roles --- - -CREATE USER PlaceHolderForUser FOR LOGIN PlaceHolderForUser; -GO -EXEC sp_addrolemember 'db_owner', PlaceHolderForUser; -GO diff --git a/src/WebPi/manifest.xml b/src/WebPi/manifest.xml deleted file mode 100644 index cfd5740051..0000000000 --- a/src/WebPi/manifest.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/WebPi/parameters.xml b/src/WebPi/parameters.xml deleted file mode 100644 index 350520407d..0000000000 --- a/src/WebPi/parameters.xml +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WebPi/umbraco/favicon.ico b/src/WebPi/umbraco/favicon.ico deleted file mode 100644 index e3ea01cf106dd2262f1941b8478a9fe69b31619a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15934 zcmds8X>3$g6ut!n14IJ>SKr_TjY<*RDj*mT z1hfUg1aK(|YK>4Z#;}yFxKLWuSPCu7%$s>L@6Gsq(|J;Er}UlKXdQC7eQ)mh&iT%L z@7{CIy`xkX{tX|l@c$KRAnFU0QUg)&r<#t!`_T_>^t`aKG~Q4u5{aax9QTGhf3rK( zZ}E5LgeMjoZw;B@-FRh==Kx9rN<=HXcYtl!mNJwjM!M`vC2qYh+~wmf<}Ksr`-;c| z#nSlce9v@k69ZW95|h}ev^5o2hia`JIm`VygQt0RCCRlVKiI_1UhdER;~%SMDr`;$ z<4~>LEpLS}b>MTJKa=R!mbk{fPhGhyjC|@&#`Z*H1Ho{IIiCma?VIcQ4Sd6y;@m_} z7`lIdV?$u9AGRdIK`K*GWA(mswzmW}@coP1CmFnN-%;o-uBf(pOL<7zuPQfh>X+xK z%pfmUex*&cO~S=(+rssMasBf=^=*x_V-IbcwJtEuEgv`SCNDK60pE0VwBb4kTPM5W z)LNSuj%U_0q&-6v+E&;06b=FqnMKDYL+!S)8}SXWUK>eUv< z?bf*J--E-!it13W*4|})&zR)S!sz_0KRfO68uNRJo7jeN82py%af~sYABFSaF_gcx z!h8JAKuLA{XCtn=?@WD;^+nfM?3qm8n%Cuf_T2N9Z`r%0W-iK@jk|(3?mc4lMY#y2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