Skip to content

Commit f862709

Browse files
committed
Simplified development setup
* Renamed `Enable-LocalTestme.ps1` to `Setup-DevEnvironment.ps1` * Made `Setup-DevEnvironment.ps1` run migrations * Updated README * Removed Windows SDK Dependency * Changed hostname to localhost instead of nuget.localtest.me * Updated the Gallery's version of ServerCommon
1 parent 547931a commit f862709

File tree

7 files changed

+157
-222
lines changed

7 files changed

+157
-222
lines changed

.vs/config/applicationhost.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@
158158
<virtualDirectory path="/" physicalPath="..\..\src\NuGetGallery" />
159159
</application>
160160
<bindings>
161-
<binding protocol="http" bindingInformation="*:80:nuget.localtest.me" />
162-
<binding protocol="https" bindingInformation="*:443:nuget.localtest.me" />
161+
<binding protocol="http" bindingInformation="*:80:localhost" />
162+
<binding protocol="https" bindingInformation="*:443:localhost" />
163163
</bindings>
164164
</site>
165165
<siteDefaults>

README.md

Lines changed: 30 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -10,79 +10,42 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
1010

1111
## Build and Run the Gallery in (arbitrary number) easy steps
1212

13-
1. Prerequisites. Install these if you don't already have them:
14-
1. Visual Studio 2015 - Custom install so that you may also install Microsoft SQL Server Data Tools. This will provide the LocalDB that Windows Azure SDK requires.
15-
2. PowerShell 2.0 (comes with Windows 7+)
16-
3. [NuGet](http://docs.nuget.org/docs/start-here/installing-nuget)
17-
4. [Windows Azure SDK](http://www.microsoft.com/windowsazure/sdk/)
13+
1. Prerequisites:
14+
1. Visual Studio 2017 - Install the following `Workloads`:
15+
* ASP.NET and web development
16+
* Azure development
17+
2. PowerShell 4.0
1818
2. Clone it!
1919

20-
```git clone [email protected]:NuGet/NuGetGallery.git```
20+
```PS C:\Code> git clone [email protected]:NuGet/NuGetGallery.git```
2121
3. Build it!
2222

2323
```
24-
cd NuGetGallery
25-
.\build
24+
PS C:\Code> cd NuGetGallery
25+
PS C:\Code\NuGetGallery> .\build
2626
```
27-
4. Set up the website in IIS Express!
28-
1. We highly recommend using IIS Express. Use the [Web Platform Installer](http://microsoft.com/web) to install it if you don't have it already (it comes with recent versions of VS and WebMatrix though). Make sure to at least once run IIS Express as an administrator.
29-
2. In an ADMIN powershell prompt, run the `.\tools\Enable-LocalTestMe.ps1` file. It allows non-admins to host websites at: `http(s)://nuget.localtest.me`, it configures an IIS Express site at that URL and creates a self-signed SSL certificate. For more information on `localtest.me`, check out [readme.localtest.me](http://readme.localtest.me). However, because [Server Name Indication](https://en.wikipedia.org/wiki/Server_Name_Indication) is not supported in the Network Shell on versions of Windows before 8, you must have at least Windows 8 to run this script successfully.
30-
3. If you're having trouble, go to the _Project Properties_ for the Website project, click on the _Web_ tab and change the URL to `localhost:port` where _port_ is some port number above 1024.
31-
32-
5. Create the Database!
33-
34-
There are two ways you can create the databases. From Visual Studio 2015 or from the command line.
35-
36-
1. From Visual Studio 2015
37-
1. Open Visual Studio 2015
38-
2. Open the Package Manager Console window
39-
3. Ensure that the Default Project is set to `NuGetGallery`
40-
4. Open the NuGetGallery.sln solution from the root of this repository. ***Important:*** Make sure the Package Manager Console has been opened once before you open the solution. If the solution was already open, open the package manager console and then close and re-open the solution (from the file menu)
41-
5. Run the following command in the Package Manager Console:
42-
43-
``` powershell
44-
Update-Database -StartUpProjectName NuGetGallery -ConfigurationTypeName MigrationsConfiguration
45-
```
46-
If this fails, you are likely to get more useful output by passing `-Debug` than `-Verbose`.
47-
2. From the command line. ***Important:*** You must have successfully built the Gallery (step 3) for this to succeed.
48-
* Run `Update-Databases.ps1` in the `tools` folder to migrate the databases to the latest version.
49-
* To Update both databases, Nuget Gallery and Support Request, run this command
50-
``` powershell
51-
.\tools\Update-Databases.ps1 -MigrationTargets NugetGallery,NugetGallerySupportRequest
52-
```
53-
* To update only the Nuget Gallery DB, run this
54-
``` powershell
55-
.\tools\Update-Databases.ps1 -MigrationTargets NugetGallery
56-
```
57-
* And to update only the Support Request DB, run this
58-
``` powershell
59-
.\tools\Update-Databases.ps1 -MigrationTargets NugetGallerySupportRequest
60-
```
61-
* Additionally you can provide a `-NugetGallerySitePath` parameter to the `Update-Databases.ps1` script to indicate that you want to perform the migration on a site other than the one that is built with this repository.
62-
63-
6. When working with the gallery, e-mail messages are saved to the file system (under `~/App_Data`).
64-
* To change this to use an SMTP server, edit `src\NuGetGallery\Web.Config` and add a `Gallery.SmtpUri` setting. Its value should be an SMTP connection string, for example `smtp://user:password@smtpservername:25`.
65-
* To turn off e-mail confirmations, edit `src\NuGetGallery\Web.Config` and change the value of `Gallery.ConfirmEmailAddresses` to `false`.
66-
67-
7. Ensure the 'NuGetGallery' project (under the Frontend folder) is set to the Startup Project
68-
69-
70-
That's it! You should now be able to press Ctrl-F5 to run the site!
71-
72-
Be aware that you might detect a change in the __applicationhost.config__:
73-
74-
Unfortunately Visual Studio will replace the relative path with an absolute path. The committed applicationhost.config-file is currently the easiest way to setup the localtest.me-binding for IIS Express.
75-
76-
However, you can force Git to ignore the change with this command:
27+
4. Set up the website!
28+
29+
```PS C:\Code\NuGetGallery> .\tools\Setup-DevEnvironment.ps1```
30+
5. Ensure the `NugetGallery` project is the StartUp Project and press `F5` to run the site! That's it!
31+
32+
When working with the gallery, e-mail messages are saved to the file system (under `~/App_Data`).
33+
You can use an SMTP server instead by editing `src\NuGetGallery\Web.Config` and adding a `Gallery.SmtpUri`
34+
setting. Its value should be an SMTP connection string, such as: `smtp://user:password@smtpservername:25`.
35+
You can also turn off e-email confirmations by changing the value of `Gallery.ConfirmEmailAddresses` to `false`
36+
in the `src\NugetGallery\Web.Config` file.
37+
38+
Visual Studio may modify the `applicationhost.config` file. You can force git to ignore changes to this file
39+
with:
7740
7841
git update-index --assume-unchanged .vs/config/applicationhost.config
7942
8043
You can undo this with this command:
8144
82-
git update-index --no-assume-unchanged .vs/config/applicationhost.config
45+
git update-index --no-assume-unchanged .vs/config/applicationhost.config
8346
84-
This should help to prevent unwanted file commits.
85-
47+
This should help prevent unwanted file commits.
48+
8649
## Contribute
8750
If you find a bug with the gallery, please visit the [Issue tracker](https://github.com/NuGet/NuGetGallery/issues) and
8851
create an issue. If you're feeling generous, please search to see if the issue is already logged before creating a
@@ -122,8 +85,7 @@ This is the Git workflow we're currently using:
12285
12386
### Setting up
12487
125-
1. Clone and checkout the following branches (to make sure local copies are made): '
126-
2. '.
88+
Clone and checkout the `dev` branch.
12789
12890
### When starting a new feature/unit of work.
12991
@@ -136,13 +98,13 @@ This is the Git workflow we're currently using:
13698
git pull dev
13799
138100
2. __Create a topic branch to do your work.__
139-
You must work in topic branches, in order to help us keep our features isolated and easily moved between branches.
101+
You must work in topic branches to help us keep our features isolated and easily moved between branches.
140102
Our policy is to start all topic branches off of the 'dev' branch.
141-
Branch names should use the following format '[user]-[bugnumber]-[shortdescription]'. If there is no bug yet,
103+
Branch names should use the following format '[user]-[bugnumber]'. If there is no bug yet,
142104
create one and assign it to yourself!
143105
144106
git checkout dev
145-
git checkout -b anurse-123-makesuckless
107+
git checkout -b anurse-123
146108
147109
3. __Do your work.__
148110
Now, do your work using the following highly accurate and efficient algorithm :)
@@ -160,7 +122,7 @@ This is the Git workflow we're currently using:
160122
5. if (moreWorkToDo) go to #3.1 else go to #4.
161123
162124
4. __Start a code review.__
163-
Start a code review by pushing your branch up to GitHub (```git push origin anurse-123-makesuckless```) and
125+
Start a code review by pushing your branch up to GitHub (```git push origin anurse-123```) and
164126
creating a Pull Request from your branch to ***dev***. Wait for at least someone on the team to respond with: ":shipit:" (that's called the
165127
"Ship-It Squirrel" and you can put it in your own comments by typing ```:shipit:```).
166128
@@ -171,7 +133,7 @@ This is the Git workflow we're currently using:
171133
172134
git checkout dev
173135
git pull origin dev
174-
git merge anurse-123-makesuckless
136+
git merge anurse-123
175137
... resolve conflicts ...
176138
git push origin dev
177139

build.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ param (
99
[string]$SemanticVersion = '1.0.0-zlocal',
1010
[string]$Branch,
1111
[string]$CommitSHA,
12-
[string]$BuildBranch = '1c479a7381ebbc0fe1fded765de70d513b8bd68e'
12+
[string]$BuildBranch = '37ff6e758c38b3f513af39f881399ce85f4ff20b'
1313
)
1414

15-
# For TeamCity - If any issue occurs, this script fail the build. - By default, TeamCity returns an exit code of 0 for all powershell scripts, even if they fail
15+
# This script should fail the build if any issue occurs.
1616
trap {
1717
Write-Host "BUILD FAILED: $_" -ForegroundColor Red
1818
Write-Host "ERROR DETAILS:" -ForegroundColor Red
@@ -81,7 +81,7 @@ Invoke-BuildStep 'Set version metadata in AssemblyInfo.cs' {
8181

8282
Invoke-BuildStep 'Building solution' {
8383
$SolutionPath = Join-Path $PSScriptRoot "NuGetGallery.sln"
84-
Build-Solution $Configuration $BuildNumber -MSBuildVersion "14" $SolutionPath -SkipRestore:$SkipRestore -MSBuildProperties "/p:MvcBuildViews=true" `
84+
Build-Solution $Configuration $BuildNumber -MSBuildVersion "15" $SolutionPath -SkipRestore:$SkipRestore -MSBuildProperties "/p:MvcBuildViews=true" `
8585
} `
8686
-ev +BuildErrors
8787

src/NuGetGallery/NuGetGallery.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2091,7 +2091,7 @@
20912091
<AutoAssignPort>True</AutoAssignPort>
20922092
<DevelopmentServerPort>80</DevelopmentServerPort>
20932093
<DevelopmentServerVPath>/</DevelopmentServerVPath>
2094-
<IISUrl>https://nuget.localtest.me</IISUrl>
2094+
<IISUrl>https://localhost</IISUrl>
20952095
<NTLMAuthentication>False</NTLMAuthentication>
20962096
<UseCustomServer>False</UseCustomServer>
20972097
<CustomServerUrl>

src/NuGetGallery/Web.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<!-- Set this if you have a Google Analytics property for the site -->
5252
<add key="Gallery.AzureCdnHost" value="" />
5353
<!-- Set this to the Azure CDN Host you are using for blob storage, if you have configured one -->
54-
<add key="Gallery.SiteRoot" value="http://nuget.localtest.me/" />
54+
<add key="Gallery.SiteRoot" value="http://localhost" />
5555
<add key="reCAPTCHA::PrivateKey" value="" />
5656
<add key="reCAPTCHA::PublicKey" value="" />
5757

tools/Enable-LocalTestMe.ps1

Lines changed: 0 additions & 147 deletions
This file was deleted.

0 commit comments

Comments
 (0)