Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removed update and revert database support form build scripts; EF 4.3…

… will have it's own scripts in the NuGet console, and we auto-update during app start, so they weren't really needed. (fixes #221)
  • Loading branch information...
commit cc3d4203f5aa331655f5106a2af61047953600fb 1 parent cd40fab
@half-ogre half-ogre authored
View
8 Build-Solution.ps1
@@ -1,13 +1,7 @@
param($connectionString = "")
$scriptPath = Split-Path $MyInvocation.MyCommand.Path
-. (join-path $scriptPath Scripts\Get-ConnectionString.ps1)
-
-if ($connectionString.Trim() -eq "")
-{
- $connectionString = Get-ConnectionString -configPath (join-path $scriptPath Website\web.config) -connectionStringName NuGetGallery
-}
$projFile = join-path $scriptPath Scripts\NuGetGallery.msbuild
-& "$(get-content env:windir)\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" $projFile /p:DbConnection=$connectionString /t:FullBuild
+& "$(get-content env:windir)\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" $projFile /t:FullBuild
View
11 Scripts/Get-ConnectionString.ps1
@@ -1,11 +0,0 @@
-function Get-ConnectionString($configPath, $connectionStringName)
-{
- $config = [xml](get-content $configPath)
-
- $connectionString = ($config.configuration.connectionStrings.add | where { $_.name -eq $connectionStringName }).connectionString
-
- $connectionString = $connectionString.Replace("=", "%3D")
- $connectionString = $connectionString.Replace(";", "%3B")
-
- return $connectionString
-}
View
13 Scripts/NuGetGallery.msbuild
@@ -4,7 +4,6 @@
</PropertyGroup>
<UsingTask AssemblyFile="../3rdParty\xunit\xunit.runner.msbuild.dll" TaskName="Xunit.Runner.MSBuild.xunit" />
- <UsingTask AssemblyFile="$(SolutionDir)..\Website\bin\NuGetGallery.Website.dll" TaskName="NuGetGallery.UpdateDatabase" />
<Target Name="Clean">
<MSBuild Projects="..\NuGetGallery.sln" Targets="Clean" Properties="Configuration=$(Configuration)"/>
@@ -17,19 +16,9 @@
<Target Name="RunFacts" DependsOnTargets="Build">
<xunit Assembly="..\Facts\bin\$(Configuration)\NuGetGallery.Facts.dll" Xml="NuGetGallery.Facts.results.xml" />
</Target>
-
- <Target Name="RevertDatabase" DependsOnTargets="Build">
- <Message Text="Reverting database" />
- <UpdateDatabase TargetMigration="0" />
- </Target>
-
- <Target Name="UpdateDatabase" DependsOnTargets="Build">
- <Message Text="Updating database" />
- <UpdateDatabase />
- </Target>
<Target Name="CIBuild" DependsOnTargets="RunFacts" />
- <Target Name="FullBuild" DependsOnTargets="RunFacts;UpdateDatabase" />
+ <Target Name="FullBuild" DependsOnTargets="RunFacts" />
</Project>
View
13 Scripts/Revert-Database.ps1
@@ -1,13 +0,0 @@
-param($connectionString = "")
-
-$scriptPath = Split-Path $MyInvocation.MyCommand.Path
-. (join-path $scriptPath Get-ConnectionString.ps1)
-
-if ("$connectionString".Trim() -eq "")
-{
- $connectionString = Get-ConnectionString -configPath (join-path $scriptPath ..\Website\web.config) -connectionStringName NuGetGallery
-}
-
-$projFile = join-path $scriptPath NuGetGallery.msbuild
-
-& "$(get-content env:windir)\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" $projFile /p:DbConnection=$connectionString /t:RevertDatabase
View
13 Scripts/Update-Database.ps1
@@ -1,13 +0,0 @@
-param($connectionString = "")
-
-$scriptPath = Split-Path $MyInvocation.MyCommand.Path
-. (join-path $scriptPath Get-ConnectionString.ps1)
-
-if ($connectionString.Trim() -eq "")
-{
- $connectionString = Get-ConnectionString -configPath (join-path $scriptPath ..\Website\web.config) -connectionStringName NuGetGallery
-}
-
-$projFile = join-path $scriptPath NuGetGallery.msbuild
-
-& "$(get-content env:windir)\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" $projFile /p:DbConnection=$connectionString /t:UpdateDatabase
View
18 Website/BuildTasks/UpdateDatabase.cs
@@ -1,18 +0,0 @@
-using System.Data.Entity.Migrations;
-using Microsoft.Build.Utilities;
-using NuGetGallery.Migrations;
-
-namespace NuGetGallery
-{
- public class UpdateDatabase : Task
- {
- public override bool Execute()
- {
- var dbMigrator = new DbMigrator(new Settings());
- dbMigrator.Update(TargetMigration);
- return true;
- }
-
- public string TargetMigration { get; set; }
- }
-}
View
1  Website/Website.csproj
@@ -280,7 +280,6 @@
<Compile Include="AuthenticationController.generated.cs">
<DependentUpon>T4MVC.tt</DependentUpon>
</Compile>
- <Compile Include="BuildTasks\UpdateDatabase.cs" />
<Compile Include="Controllers\ApiController.cs" />
<Compile Include="Controllers\JsonApiController.cs" />
<Compile Include="Controllers\PagesController.cs" />
Please sign in to comment.
Something went wrong with that request. Please try again.