diff --git a/.gitignore b/.gitignore index 75d34fe..3b7d1fe 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ #VS 2015 hidden folder src/.vs/* -build/tools/vswhere.2.0.2 +build/tools/vswhere* build/tools/vswhere.exe artifacts/* diff --git a/README.md b/README.md index 04a43b5..377da2b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# UmbracoFileSystemProviders.Azure +# UmbracoFileSystemProviders.Azure v1 + +**This version is for Umbraco v7 only**. For the v2 package for **Umbraco v8** please visit the [develop-umbraco-version-8 branch](https://github.com/JimBobSquarePants/UmbracoFileSystemProviders.Azure/tree/develop-umbraco-version-8) ![Image Alt](build/assets/logo/azure-logo-256.png) @@ -16,7 +18,7 @@ Both NuGet and Umbraco packages are available. If you use NuGet but would like t |NuGet Packages |Version | |:-----------------|:-----------------| |**Release**|[![NuGet download](http://img.shields.io/nuget/v/UmbracoFileSystemProviders.Azure.svg)](https://www.nuget.org/packages/UmbracoFileSystemProviders.Azure/)|[![NuGet count](https://img.shields.io/nuget/dt/UmbracoFileSystemProviders.Azure.svg)](https://www.nuget.org/packages/UmbracoFileSystemProviders.Azure/)| -|**Pre-release**|[![MyGet download](https://img.shields.io/myget/umbracofilesystemproviders-azure/vpre/UmbracoFileSystemProviders.Azure.svg)](https://www.myget.org/gallery/umbracofilesystemproviders-azure)|[![MyGet count](https://img.shields.io/myget/umbracofilesystemproviders-azure/dt/UmbracoFileSystemProviders.Azure.svg)](https://www.myget.org/gallery/umbracofilesystemproviders-azure)| +|**Pre-release**|[![MyGet download](https://img.shields.io/myget/umbraco-packages/vpre/UmbracoFileSystemProviders.Azure.svg)](https://www.myget.org/feed/umbraco-packages/package/nuget/UmbracoFileSystemProviders.Azure)|[![MyGet count](https://img.shields.io/myget/umbraco-packages/dt/UmbracoFileSystemProviders.Azure.svg)](https://www.myget.org/feed/umbraco-packages/package/nuget/UmbracoFileSystemProviders.Azure)| |Umbraco Packages | | |:-----------------|:-----------------| @@ -51,7 +53,7 @@ Update `~/Config/FileSystemProviders.config` replacing the default provider with - + + + + + + + + +``` + +Or in `Web.config` + +```xml + +``` + +#### Configuration for Azure Key Vault +For Azure Key Vault only the key values in the `Web.config` should use '-', rather than a '.' or ':' as shown below + +```xml + + + + + + +``` + ## Virtual Path Provider By default the plugin will serve files transparently from your domain or serve media directly from Azure. This is made possible by using a custom [Virtual Path Provider](https://msdn.microsoft.com/en-us/library/system.web.hosting.virtualpathprovider%28v=vs.110%29.aspx) included and automatically initialised upon application startup. This can be disable by adding the configuration setting noted above. @@ -186,7 +231,7 @@ the cloud simply install the [configuration package](https://www.nuget.org/packa - + @@ -206,7 +251,7 @@ If using a version of ImageProcessor.Web version [4.5.0](https://www.nuget.org/p - + diff --git a/appveyor.yml b/appveyor.yml index b837045..2f49225 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,17 +1,27 @@ os: Visual Studio 2017 # Version format -version: 1.0.3.{build} +version: 1.2.1.{build} cache: - src\packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified -# UMBRACO_PACKAGE_PRERELEASE_SUFFIX if a rtm release build this should be blank, otherwise if empty will default to alpha -# example UMBRACO_PACKAGE_PRERELEASE_SUFFIX=beta -init: - - set UMBRACO_PACKAGE_PRERELEASE_SUFFIX= +configuration: Release + +environment: + # Version Suffix + version_suffix: alpha install: + - ps: .\build\appveyor-semver.ps1 + - ps: .\build\check-release-version.ps1 + - ps: Update-AppveyorBuild -Version $Env:appveyor_version + - cmd: >- + cd build + + npm install + + cd.. - ps: >- $msiPath = "$($env:USERPROFILE)\MicrosoftAzureStorageEmulator.msi" @@ -19,11 +29,21 @@ install: cmd /c start /wait msiexec /i $msiPath /quiet +assembly_info: + patch: true + file: 'src\UmbracoFileSystemProviders.Azure**\AssemblyInfo.*' + assembly_version: '$(appveyor_file_version)' + assembly_file_version: '$(appveyor_file_version)' + assembly_informational_version: '$(mssemver)' + build_script: -- build-appveyor.cmd +- cmd: >- + build-appveyor.cmd + + cd.. before_test: -- cmd: '"%programfiles(x86)%\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe" start' +- cmd: '"%programfiles(x86)%\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe" start' # Turn tests off just now test: on @@ -32,33 +52,95 @@ artifacts: - path: artifacts\*.zip deploy: - # MyGet Deployment for builds & releases + # Umbraco MyGet community feed - v3 + - provider: NuGet + server: https://www.myget.org/F/umbraco-packages/api/v2/package + symbol_server: https://www.myget.org/F/umbraco-packages/symbols/api/v2/package + api_key: + secure: yvlnQEq6tmxGOdbtTuKyAhcdY1GCD98/sG9+Qo7y7SNb89GAbjLXxueOMspkjvUh + artifact: /.*\.nupkg/ + on: + branch: develop-version-3 + + # GitHub Deployment for releases -v3 + - provider: GitHub + auth_token: + secure: Kucu1gQQf8bjRlkR72fyZUiUtmkz7rtZEIgK/RMT1pMnq700m5sSQTiFHOSQUdR5 + artifact: /.*\.zip/ # upload all Zip packages to release assets + draft: false + prerelease: false + on: + branch: main-version-3 + appveyor_repo_tag: true # deploy on tag push only + + # NuGet Deployment for releases - v3 + - provider: NuGet + server: + api_key: + secure: TtE4dizVNNLoy4gfrJDGRH1/vfNMTXiAxuMW0va1bcO1ZPXCw0qy12PUfIB+h9O3 + artifact: /.*\.nupkg/ + on: + branch: main-version-3 + appveyor_repo_tag: true + + # Umbraco MyGet community feed + - provider: NuGet + server: https://www.myget.org/F/umbraco-packages/api/v2/package + symbol_server: https://www.myget.org/F/umbraco-packages/symbols/api/v2/package + api_key: + secure: yvlnQEq6tmxGOdbtTuKyAhcdY1GCD98/sG9+Qo7y7SNb89GAbjLXxueOMspkjvUh + artifact: /.*\.nupkg/ + on: + branch: develop-version-2 + + # GitHub Deployment for releases -v2 + - provider: GitHub + auth_token: + secure: Kucu1gQQf8bjRlkR72fyZUiUtmkz7rtZEIgK/RMT1pMnq700m5sSQTiFHOSQUdR5 + artifact: /.*\.zip/ # upload all Zip packages to release assets + draft: false + prerelease: false + on: + branch: master-version-2 + appveyor_repo_tag: true # deploy on tag push only + + # NuGet Deployment for releases - v2 + - provider: NuGet + server: + api_key: + secure: TtE4dizVNNLoy4gfrJDGRH1/vfNMTXiAxuMW0va1bcO1ZPXCw0qy12PUfIB+h9O3 + artifact: /.*\.nupkg/ + on: + branch: master-version-2 + appveyor_repo_tag: true + + # MyGet Deployment for builds & releases -v1 - provider: NuGet - server: https://www.myget.org/F/umbracofilesystemproviders-azure/api/v2/package - symbol_server: https://www.myget.org/F/umbracofilesystemproviders-azure/symbols/api/v2/package + server: https://www.myget.org/F/umbraco-packages/api/v2/package + symbol_server: https://www.myget.org/F/umbraco-packages/symbols/api/v2/package api_key: - secure: fz0rUrt3B1HczUC1ZehwVsrFSWX9WZGDQoueDztLte9/+yQG+BBU7UrO+coE8lUf + secure: yvlnQEq6tmxGOdbtTuKyAhcdY1GCD98/sG9+Qo7y7SNb89GAbjLXxueOMspkjvUh artifact: /.*\.nupkg/ on: - branch: develop + branch: develop-version-1 - # GitHub Deployment for releases + # GitHub Deployment for releases -v1 - provider: GitHub auth_token: - secure: gnJNHw3btYiQ7G0GexIGpSyA3moAz/GuJvgGZvJmz63/+YVLFC+qew/xlniRLDSk + secure: Kucu1gQQf8bjRlkR72fyZUiUtmkz7rtZEIgK/RMT1pMnq700m5sSQTiFHOSQUdR5 artifact: /.*\.zip/ # upload all Zip packages to release assets draft: false prerelease: false on: - branch: master + branch: main-version-1 appveyor_repo_tag: true # deploy on tag push only - # NuGet Deployment for releases + # NuGet Deployment for releases - v1 - provider: NuGet server: api_key: - secure: kHataLiMb9nmJEdwBE4BTXvA4nOpoD3Fw14zVeDP6Vs0ZXpL7c8qeegMv/jMZECP + secure: TtE4dizVNNLoy4gfrJDGRH1/vfNMTXiAxuMW0va1bcO1ZPXCw0qy12PUfIB+h9O3 artifact: /.*\.nupkg/ on: - branch: master + branch: main-version-1 appveyor_repo_tag: true diff --git a/build-appveyor.cmd b/build-appveyor.cmd index d6891b9..2039e0d 100644 --- a/build-appveyor.cmd +++ b/build-appveyor.cmd @@ -2,6 +2,7 @@ ECHO APPVEYOR_REPO_BRANCH: %APPVEYOR_REPO_BRANCH% ECHO APPVEYOR_REPO_TAG: %APPVEYOR_REPO_TAG% ECHO APPVEYOR_BUILD_NUMBER : %APPVEYOR_BUILD_NUMBER% ECHO APPVEYOR_BUILD_VERSION : %APPVEYOR_BUILD_VERSION% +ECHO CONFIGURATION : %CONFIGURATION% CALL NuGet.exe restore src\UmbracoFileSystemProviders.Azure.sln @@ -14,24 +15,28 @@ IF NOT EXIST "%toolsFolder%" ( IF NOT EXIST "%toolsFolder%vswhere.exe" ( ECHO vswhere not found - fetching now - nuget install vswhere -Version 2.0.2 -Source nuget.org -OutputDirectory tools + nuget install vswhere -Version 2.7.1 -Source nuget.org -OutputDirectory tools ) FOR /f "delims=" %%A in ('dir "%toolsFolder%vswhere.*" /b') DO SET "vswhereExePath=%toolsFolder%%%A\" MOVE "%vswhereExePath%tools\vswhere.exe" "%toolsFolder%vswhere.exe" -for /f "usebackq tokens=1* delims=: " %%i in (`"%CD%\tools\vswhere.exe" -latest -requires Microsoft.Component.MSBuild`) do ( - if /i "%%i"=="installationPath" set InstallDir=%%j -) +SETLOCAL EnableDelayedExpansion + +:: This string specifies vs 2019 +:: set vswherestr=^"!%CD%\tools\vswhere.exe^" -version [16.0,17.0^^) -latest -prerelease -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe -SET VSWherePath="%InstallDir%\MSBuild" +set vswherestr=^"!%CD%\tools\vswhere.exe^" -latest -prerelease -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe +for /f "usebackq tokens=*" %%i in (`!vswherestr!`) do ( + set MsBuildDir=%%i +) ECHO. -ECHO Visual Studio is installed in: %InstallDir% +ECHO MsBuild is installed in: %MsBuildDir% -CALL "%InstallDir%\MSBuild\15.0\Bin\amd64\MsBuild.exe" package.proj %~1 +CALL "%MsBuildDir%" package.proj %~1 @IF %ERRORLEVEL% NEQ 0 GOTO err @EXIT /B 0 :err -@EXIT /B 1 +@EXIT /B 1 \ No newline at end of file diff --git a/build.cmd b/build.cmd index 46c4c5d..992de0b 100644 --- a/build.cmd +++ b/build.cmd @@ -2,7 +2,7 @@ ECHO off SET /P APPVEYOR_BUILD_NUMBER=Please enter a build number (e.g. 134): SET /P PACKAGE_VERISON=Please enter your package version (e.g. 1.0.5): -SET /P UMBRACO_PACKAGE_PRERELEASE_SUFFIX=Please enter your package release suffix or leave empty (e.g. beta): +SET /P version_suffix=Please enter your package release suffix or leave empty (e.g. beta): SET /P APPVEYOR_REPO_TAG=If you want to simulate a GitHub tag for a release (e.g. true): @@ -13,10 +13,19 @@ if "%PACKAGE_VERISON%" == "" ( SET PACKAGE_VERISON=0.1.0 ) -SET APPVEYOR_BUILD_VERSION=%PACKAGE_VERISON%.%APPVEYOR_BUILD_NUMBER% +SET mssemver=%PACKAGE_VERISON%-beta-%APPVEYOR_BUILD_NUMBER% + +SET CONFIGURATION=Debug + +cd build +call npm install +call node appveyor-nuspec-patch.js +cd.. build-appveyor.cmd +cd.. + @IF %ERRORLEVEL% NEQ 0 GOTO err @EXIT /B 0 :err diff --git a/build/UmbracoFileSystemProviders.Azure.proj b/build/UmbracoFileSystemProviders.Azure.proj index 4fbace6..34357b1 100644 --- a/build/UmbracoFileSystemProviders.Azure.proj +++ b/build/UmbracoFileSystemProviders.Azure.proj @@ -40,33 +40,8 @@ - $(APPVEYOR_BUILD_VERSION) + $(mssemver) - - - - false - - - - - true - - - - - - - - true - - - - - false - - - @@ -81,16 +56,9 @@ $(RootDir)\src\UmbracoFileSystemProviders.Azure.Tests - - - - - - - - + @@ -99,19 +67,8 @@ - - - - - - - - - - - - + @@ -190,7 +147,7 @@ WorkingDirectory="$(BuildUmbDir)" MinimumRequiredUmbracoVersion="$(MinUmbracoVersion)" PackageName="$(PackageName)" - PackageVersion="$(ProductVersion)" + PackageVersion="$(FileVersion)" AuthorName="$(AuthorName)" AuthorUrl="$(AuthorUrl)" IconUrl="$(IconUrl)" @@ -212,8 +169,8 @@ Title="$(PackageName)" Description="$(Description)" Summary="$(Readme)" - Version="$(ProductVersion)" - MinimumRequiredUmbracoVersion ="$(MinUmbracoVersion)" + Version="$(FileVersion)" + MinimumRequiredUmbracoVersion ="[$(MinUmbracoVersion),8.0.0)" Authors="$(AuthorName)" Owners="$(Owners)" Copyright="$(Copyright)" @@ -241,7 +198,7 @@ diff --git a/build/appveyor-semver.ps1 b/build/appveyor-semver.ps1 new file mode 100644 index 0000000..c742d63 --- /dev/null +++ b/build/appveyor-semver.ps1 @@ -0,0 +1,24 @@ +$version=[Version]$Env:APPVEYOR_BUILD_VERSION +$version_suffix=$Env:version_suffix + +$basever=$version.Major.ToString() + "." + $version.Minor.ToString() + "." + $version.Build.ToString() + +$paddedRevision = $version.Revision.ToString().PadLeft(6,"0") + +$semver = $basever + "-" + $version_suffix + "." + $version.Revision.ToString() +$mssemver = $basever + "-" + $version_suffix + "-" + $paddedRevision +$appveyor_version = $mssemver + +$Env:semver = $semver +$Env:mssemver = $mssemver +$Env:appveyor_version = $appveyor_version + +$Env:appveyor_file_version = $Env:APPVEYOR_BUILD_VERSION + +$Env:ms_file_version = $version.ToString() +$Env:padded_build_revision = $paddedRevision + +"Envrionment variable 'semver' set:" + $Env:semver +"Envrionment variable 'mssemver' set:" + $Env:mssemver +"Envrionment variable 'appveyor_version' set:" + $Env:appveyor_version +"Envrionment variable 'padded_build_revision' set:" + $Env:padded_build_revision \ No newline at end of file diff --git a/build/check-release-version.ps1 b/build/check-release-version.ps1 new file mode 100644 index 0000000..c33fc6d --- /dev/null +++ b/build/check-release-version.ps1 @@ -0,0 +1,57 @@ +$tagged=$Env:APPVEYOR_REPO_TAG +$tag_name=$Env:APPVEYOR_REPO_TAG_NAME +$version=[Version]$Env:APPVEYOR_BUILD_VERSION +$branch=$Env:APPVEYOR_REPO_BRANCH + +$Env:tagged_release_build = "false" + +#$tagged="true" +#$tag_name="v2.1.2-beta" +#$version=[Version]"2.1.2.12" + +$has_suffix = "false" +$suffix = "" + +"APPVEYOR_REPO_TAG:" + $tagged +"APPVEYOR_REPO_TAG_NAME:" + $tag_name + +If ($tagged -eq "true" -and $tag_name.StartsWith("v")){ + + # This is to cut out the beta etc + if ($tag_name.Contains("-")){ + $has_suffix = "true" + $index = $tag_name.indexof("-"); + $suffix = $tag_name.Substring($index + 1, $tag_name.Length - ($index + 1)) + $tag_name = $tag_name.Substring(0, $index) + } + + $tagged_version=[Version]$tag_name.Substring(1) + + if ($tagged_version.Major -eq $version.Major -and $tagged_version.Minor -eq $version.Minor -and $tagged_version.Build -eq $version.Build){ + "** THIS IS A TAGGED RELEASE BUILD:" + $tagged_version.ToString() + " **" + + $Env:tagged_release_build = "true" + + $basever=$tagged_version.Major.ToString() + "." + $tagged_version.Minor.ToString() + "." + $tagged_version.Build.ToString() + + if ($has_suffix -eq "true"){ + $Env:version_suffix = $suffix + + $Env:mssemver = $basever + "-" + $suffix + $Env:appveyor_version = $basever + "-" + $suffix + $Env:semver = $basever + "-" + $suffix + } Else { + $Env:mssemver = $basever + $Env:appveyor_version = $basever + $Env:semver = $basever + } + + "Envrionment variable 'semver' set:" + $Env:semver + "Envrionment variable 'mssemver' set:" + $Env:mssemver + "Envrionment variable 'appveyor_version' set:" + $Env:appveyor_version + }Else{ + "** Naughty, naughty, very naughty, tagged version: " + $tagged_version.ToString() + " doesn't match build version:" + $version.ToString() + " **" + "** If this was intentional you should manually bump the version in appveyor.yml **" + $host.SetShouldExit(1) + } +} \ No newline at end of file diff --git a/build/package.json b/build/package.json new file mode 100644 index 0000000..3390d89 --- /dev/null +++ b/build/package.json @@ -0,0 +1,15 @@ +{ + "name": "appveyorpatch", + "description": "All NodeJs stuff needed to be cool", + "repository": "", + "license": "UNLICENSED", + "version": "1.0.0", + "dependencies": { + "jsonfile": "^2.2.3", + "semver": "^5.0.3", + "xmldom": "^0.5.0", + "read-file": "^0.2.0", + "write": "^0.3.2", + "js-yaml": "^3.7.0" + } +} diff --git a/build/tools/MSBuildNugetTasks/MSBuild.NuGet.Tasks.dll b/build/tools/MSBuildNugetTasks/MSBuild.NuGet.Tasks.dll index d7bc3f3..6f83bc4 100644 Binary files a/build/tools/MSBuildNugetTasks/MSBuild.NuGet.Tasks.dll and b/build/tools/MSBuildNugetTasks/MSBuild.NuGet.Tasks.dll differ diff --git a/build/tools/NuGet.exe b/build/tools/NuGet.exe index 83ead7a..7d8aeb3 100644 Binary files a/build/tools/NuGet.exe and b/build/tools/NuGet.exe differ diff --git a/build/transforms/FileSystemProviders.config.install.xdt b/build/transforms/FileSystemProviders.config.install.xdt index d7753e6..811f9d6 100644 --- a/build/transforms/FileSystemProviders.config.install.xdt +++ b/build/transforms/FileSystemProviders.config.install.xdt @@ -10,7 +10,7 @@ - + diff --git a/src/UmbracoFileSystemProviders.Azure.Tests/FileSystemProviders.upgrade.config b/src/UmbracoFileSystemProviders.Azure.Tests/FileSystemProviders.upgrade.config index c2c5931..ece1c80 100644 --- a/src/UmbracoFileSystemProviders.Azure.Tests/FileSystemProviders.upgrade.config +++ b/src/UmbracoFileSystemProviders.Azure.Tests/FileSystemProviders.upgrade.config @@ -5,7 +5,7 @@ - +