forked from AdminTurnedDevOps/DevOps-The-Hard-Way-AWS
-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Thomas Thornton
committed
Oct 21, 2024
1 parent
8c31bc4
commit ccc29a3
Showing
74 changed files
with
40,140 additions
and
102 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,16 @@ | ||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build-env | ||
WORKDIR /app | ||
|
||
# Copy csproj and restore as distinct layers | ||
COPY *.csproj ./ | ||
RUN dotnet restore | ||
|
||
# Copy everything else and build | ||
COPY . ./ | ||
RUN dotnet publish -c Release -o out | ||
|
||
# Build runtime image | ||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim | ||
WORKDIR /app | ||
COPY --from=build-env /app/out . | ||
ENTRYPOINT ["dotnet", "aspnet-core-dotnet-core.dll"] |
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,9 @@ | ||
@page | ||
@model AboutModel | ||
@{ | ||
ViewData["Title"] = "About"; | ||
} | ||
<br /> | ||
<h4>Your application description page.</h4> | ||
|
||
<p>Use this area to provide additional information.</p> |
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,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
|
||
namespace aspnet_core_dotnet_core.Pages | ||
{ | ||
public class AboutModel : PageModel | ||
{ | ||
public void OnGet() | ||
{ | ||
} | ||
} | ||
} |
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,21 @@ | ||
@page | ||
@model ContactModel | ||
@{ | ||
ViewData["Title"] = "Contact"; | ||
} | ||
<br /> | ||
<h4>Your contact page.</h4> | ||
|
||
<address> | ||
One Microsoft Way<br /> | ||
Redmond, WA 98052-6399<br /> | ||
<abbr title="Phone">P:</abbr> | ||
425.555.0100 | ||
</address> | ||
|
||
<address> | ||
<strong>Support:</strong> <a href="mailto:[email protected]">Support@example.com</a><br /> | ||
<strong>Marketing:</strong> <a href="mailto:[email protected]">Marketing@example.com</a> | ||
</address> | ||
|
||
|
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,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
|
||
namespace aspnet_core_dotnet_core.Pages | ||
{ | ||
public class ContactModel : PageModel | ||
{ | ||
public void OnGet() | ||
{ | ||
} | ||
} | ||
} |
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,26 @@ | ||
@page | ||
@model ErrorModel | ||
@{ | ||
ViewData["Title"] = "Error"; | ||
} | ||
|
||
<h1 class="text-danger">Error.</h1> | ||
<h2 class="text-danger">An error occurred while processing your request.</h2> | ||
|
||
@if (Model.ShowRequestId) | ||
{ | ||
<p> | ||
<strong>Request ID:</strong> <code>@Model.RequestId</code> | ||
</p> | ||
} | ||
|
||
<h3>Development Mode</h3> | ||
<p> | ||
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred. | ||
</p> | ||
<p> | ||
<strong>The Development environment shouldn't be enabled for deployed applications.</strong> | ||
It can result in displaying sensitive information from exceptions to end users. | ||
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong> | ||
and restarting the app. | ||
</p> |
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,23 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
|
||
namespace aspnet_core_dotnet_core.Pages | ||
{ | ||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] | ||
public class ErrorModel : PageModel | ||
{ | ||
public string RequestId { get; set; } | ||
|
||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); | ||
|
||
public void OnGet() | ||
{ | ||
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; | ||
} | ||
} | ||
} |
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,43 @@ | ||
@page | ||
@model IndexModel | ||
@{ | ||
ViewData["Title"] = "Home Page - ASP.NET Core 3.1"; | ||
} | ||
|
||
<div class="main-container"> | ||
<div class="cloud-image"> | ||
<img src="~/images/successCloudNew.svg" /> | ||
</div> | ||
<div class="content"> | ||
<div class="tweet-container"> | ||
<a href="http://twitter.com/intent/tweet/?text=I%20just%20created%20a%20new%20ASP.net%20website%20on%20Azure%20using%20Azure%20DevOps%20Project&hashtags=AzureDevOpsProject%2CVSTS%20%40Azure%20%40VSTS"> | ||
<img src="~/images/tweetThis.svg" /> | ||
</a> | ||
</div> | ||
<div class="content-body"> | ||
<div class="success-text">Success!</div> | ||
<div class="description line-1"> Azure DevOps Project has been successfully setup</div> | ||
<div class="description line-2"> Your ASP.NET Core app is up and running on Azure</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-4"> | ||
<h2>Get started right away </h2> | ||
<p> | ||
Clone your code repository and start developing your application on IDE of your choice | ||
</p> | ||
<p><a class="btn btn-light" href="https://go.microsoft.com/fwlink/?linkid=862409">Learn more »</a></p> | ||
</div> | ||
<div class="col-md-4"> | ||
<h2>Continuous Delivery</h2> | ||
<p>View your CI/CD pipeline on Azure Devops and customize it as per your needs</p> | ||
<p><a class="btn btn-light" href="https://go.microsoft.com/fwlink/?linkid=862410">Learn more »</a></p> | ||
</div> | ||
<div class="col-md-4"> | ||
<h2>Azure DevOps Project</h2> | ||
<p>Learn more about all you can do with Azure DevOps project by visiting the documentation</p> | ||
<p><a class="btn btn-light" href="https://go.microsoft.com/fwlink/?linkid=862126">Learn more »</a></p> | ||
</div> | ||
</div> | ||
|
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,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
|
||
namespace aspnet_core_dotnet_core.Pages | ||
{ | ||
public class IndexModel : PageModel | ||
{ | ||
public void OnGet() | ||
{ | ||
|
||
} | ||
public string DoTest() | ||
{ | ||
return "Index"; | ||
} | ||
} | ||
} |
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,8 @@ | ||
@page | ||
@model PrivacyModel | ||
@{ | ||
ViewData["Title"] = "Privacy Policy"; | ||
} | ||
<h1>@ViewData["Title"]</h1> | ||
|
||
<p>Use this page to detail your site's privacy policy.</p> |
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,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
|
||
namespace aspnet_core_dotnet_core.Pages | ||
{ | ||
public class PrivacyModel : PageModel | ||
{ | ||
public void OnGet() | ||
{ | ||
} | ||
} | ||
} |
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,25 @@ | ||
@using Microsoft.AspNetCore.Http.Features | ||
|
||
@{ | ||
var consentFeature = Context.Features.Get<ITrackingConsentFeature>(); | ||
var showBanner = !consentFeature?.CanTrack ?? false; | ||
var cookieString = consentFeature?.CreateConsentCookie(); | ||
} | ||
|
||
@if (showBanner) | ||
{ | ||
<div id="cookieConsent" class="alert alert-info alert-dismissible fade show" role="alert"> | ||
Use this space to summarize your privacy and cookie use policy. <a asp-page="/Privacy">Learn More</a>. | ||
<button type="button" class="accept-policy close" data-dismiss="alert" aria-label="Close" data-cookie-string="@cookieString"> | ||
<span aria-hidden="true">Accept</span> | ||
</button> | ||
</div> | ||
<script> | ||
(function () { | ||
var button = document.querySelector("#cookieConsent button[data-cookie-string]"); | ||
button.addEventListener("click", function (event) { | ||
document.cookie = button.dataset.cookieString; | ||
}, false); | ||
})(); | ||
</script> | ||
} |
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,80 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>@ViewData["Title"]</title> | ||
|
||
<environment include="Development"> | ||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" /> | ||
</environment> | ||
<environment exclude="Development"> | ||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" | ||
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css" | ||
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" | ||
crossorigin="anonymous" | ||
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" /> | ||
</environment> | ||
<link rel="stylesheet" href="~/css/site.min.css" /> | ||
</head> | ||
<body> | ||
<header> | ||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-dark bg-dark"> | ||
<div class="container"> | ||
<a class="navbar-brand" asp-area="" asp-page="/Index">ASP.NET Core</a> | ||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent" | ||
aria-expanded="false" aria-label="Toggle navigation"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse"> | ||
<ul class="navbar-nav flex-grow-1"> | ||
<li class="nav-item"> | ||
<a class="nav-link text-light" asp-area="" asp-page="/Index">Home</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link text-light" asp-area="" asp-page="/About">About</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link text-light" asp-area="" asp-page="/Contact">Contact</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</nav> | ||
</header> | ||
<div class="container"> | ||
<partial name="_CookieConsentPartial" /> | ||
<main role="main" class="pb-3"> | ||
@RenderBody() | ||
</main> | ||
</div> | ||
|
||
<footer class="border-top footer text-muted"> | ||
<div class="container"> | ||
© ASP.NET Core | ||
</div> | ||
</footer> | ||
|
||
<environment include="Development"> | ||
<script src="~/lib/jquery/dist/jquery.js"></script> | ||
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script> | ||
</environment> | ||
<environment exclude="Development"> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" | ||
asp-fallback-src="~/lib/jquery/dist/jquery.min.js" | ||
asp-fallback-test="window.jQuery" | ||
crossorigin="anonymous" | ||
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="> | ||
</script> | ||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js" | ||
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js" | ||
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal" | ||
crossorigin="anonymous" | ||
integrity="sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o"> | ||
</script> | ||
</environment> | ||
<script src="~/js/site.min.js" asp-append-version="true"></script> | ||
|
||
@RenderSection("Scripts", required: false) | ||
</body> | ||
</html> |
18 changes: 18 additions & 0 deletions
18
3-Docker/app/Pages/Shared/_ValidationScriptsPartial.cshtml
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,18 @@ | ||
<environment include="Development"> | ||
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script> | ||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script> | ||
</environment> | ||
<environment exclude="Development"> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.17.0/jquery.validate.min.js" | ||
asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js" | ||
asp-fallback-test="window.jQuery && window.jQuery.validator" | ||
crossorigin="anonymous" | ||
integrity="sha256-F6h55Qw6sweK+t7SiOJX+2bpSAa3b/fnlrVCJvmEj1A="> | ||
</script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validation-unobtrusive/3.2.11/jquery.validate.unobtrusive.min.js" | ||
asp-fallback-src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js" | ||
asp-fallback-test="window.jQuery && window.jQuery.validator && window.jQuery.validator.unobtrusive" | ||
crossorigin="anonymous" | ||
integrity="sha256-9GycpJnliUjJDVDqP0UEu/bsm9U+3dnQUH8+3W10vkY="> | ||
</script> | ||
</environment> |
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,3 @@ | ||
@using aspnet_core_dotnet_core | ||
@namespace aspnet_core_dotnet_core.Pages | ||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers |
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,3 @@ | ||
@{ | ||
Layout = "_Layout"; | ||
} |
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,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace aspnet_core_dotnet_core | ||
{ | ||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
CreateWebHostBuilder(args).Build().Run(); | ||
} | ||
|
||
public static IWebHostBuilder CreateWebHostBuilder(string[] args) => | ||
WebHost.CreateDefaultBuilder(args) | ||
.UseStartup<Startup>(); | ||
} | ||
} |
Oops, something went wrong.