forked from PuzzleServer/mainpuzzleserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Azure deployment glue (PuzzleServer#118)
* Adds logic required to deploy to Azure using Continuous Deployment. * Yaml updates
- Loading branch information
Showing
7 changed files
with
119 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using ServerCore.DataModel; | ||
|
||
namespace ServerCore.Areas.Deployment | ||
{ | ||
public class DeploymentConfiguration | ||
{ | ||
internal static void ConfigureDatabase(IConfiguration configuration, IServiceCollection services) | ||
{ | ||
// Use SQL Database if in Azure, otherwise, use localdb | ||
if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Development") | ||
{ | ||
|
||
services.AddDbContext<PuzzleServerContext> | ||
(options => options.UseLazyLoadingProxies() | ||
.UseSqlServer(configuration.GetConnectionString("PuzzleServerSQLConnectionString"))); | ||
} | ||
else | ||
{ | ||
services.AddDbContext<PuzzleServerContext> | ||
(options => options.UseLazyLoadingProxies() | ||
.UseSqlServer(configuration.GetConnectionString("PuzzleServerContextLocal"))); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
ServerCore/Properties/PublishProfiles/PuzzleServerTestDeploy - Web Deploy.pubxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
This file is used by the publish/package process of your Web project. You can customize the behavior of this process | ||
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121. | ||
--> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<WebPublishMethod>MSDeploy</WebPublishMethod> | ||
<ResourceId>/subscriptions/3ffc52f4-eed1-4312-8170-9caf82ff0949/resourcegroups/PuzzleServerTestDeploy/providers/Microsoft.Web/sites/PuzzleServerTestDeploy</ResourceId> | ||
<ResourceGroup>PuzzleServerTestDeploy</ResourceGroup> | ||
<PublishProvider>AzureWebSite</PublishProvider> | ||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> | ||
<LastUsedPlatform>Any CPU</LastUsedPlatform> | ||
<SiteUrlToLaunchAfterPublish>https://puzzleservertestdeploy.azurewebsites.net</SiteUrlToLaunchAfterPublish> | ||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> | ||
<ExcludeApp_Data>False</ExcludeApp_Data> | ||
<ProjectGuid>67b91cce-4e3d-4f0f-8a76-eafd37c5f949</ProjectGuid> | ||
<MSDeployServiceURL>puzzleservertestdeploy.scm.azurewebsites.net:443</MSDeployServiceURL> | ||
<DeployIisAppPath>PuzzleServerTestDeploy</DeployIisAppPath> | ||
<RemoteSitePhysicalPath /> | ||
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer> | ||
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod> | ||
<EnableMSDeployBackup>True</EnableMSDeployBackup> | ||
<UserName>$PuzzleServerTestDeploy</UserName> | ||
<_SavePWD>True</_SavePWD> | ||
<_DestinationType>AzureWebSite</_DestinationType> | ||
<InstallAspNetCoreSiteExtension>False</InstallAspNetCoreSiteExtension> | ||
<KeyVaultUri>https://PuzzleServerTestKeyVault.vault.azure.net</KeyVaultUri> | ||
<TargetFramework>netcoreapp2.1</TargetFramework> | ||
<SelfContained>false</SelfContained> | ||
<_IsPortable>true</_IsPortable> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters