From 2ca9b53770775f0fafb96cd04b753cd79101ba2f Mon Sep 17 00:00:00 2001
From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com>
Date: Mon, 15 Apr 2024 11:19:52 -0500
Subject: [PATCH 1/2] fix: use blue to refer to existing version and green to
refer to new version
---
scripts/deploy.ps1 | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/scripts/deploy.ps1 b/scripts/deploy.ps1
index d85fc07..66f9fee 100644
--- a/scripts/deploy.ps1
+++ b/scripts/deploy.ps1
@@ -116,19 +116,19 @@ if ($LASTEXITCODE -ne 0)
}
# Checkif green container is running
-$greenContainerId = docker ps --filter "name=blog.stevanfreeborn.com.green" --format "{{.ID}}"
+$blueContainerId = docker ps --filter "name=blog.stevanfreeborn.com.blue" --format "{{.ID}}"
-if ($null -eq $greenContainerId)
+if ($null -eq $blueContainerId)
{
- Write-Host "Green container is not running. Starting green container."
+ Write-Host "Blue container is not running. Starting blue container."
- $greenContainerHostPort = StartContainer -containerColor "green" -dockerTag $dockerTag
+ $blueContainerHostPort = StartContainer -containerColor "blue" -dockerTag $dockerTag
- Write-Host "Green container is running."
+ Write-Host "Blue container is running."
- UpdateNginxConfig -filePath $NGINX_CONFIG_PATH -portNumber $greenContainerHostPort
+ UpdateNginxConfig -filePath $NGINX_CONFIG_PATH -portNumber $blueContainerHostPort
- Write-Host "Nginx configuration updated to point to green container on port $greenContainerHostPort."
+ Write-Host "Nginx configuration updated to point to blue container on port $blueContainerHostPort."
nginx -t
@@ -152,15 +152,15 @@ if ($null -eq $greenContainerId)
}
else
{
- Write-Host "Green container is running. Starting blue container."
+ Write-Host "Blue container is running. Starting green container."
- $blueContainerHostPort = StartContainer -containerColor "blue" -dockerTag $dockerTag
+ $greenContainerHostPort = StartContainer -containerColor "green" -dockerTag $dockerTag
- Write-Host "Blue container is running."
+ Write-Host "Green container is running."
- UpdateNginxConfig -filePath $NGINX_CONFIG_PATH -portNumber $blueContainerHostPort
+ UpdateNginxConfig -filePath $NGINX_CONFIG_PATH -portNumber $greenContainerHostPort
- Write-Host "Nginx configuration updated to point to blue container on port $blueContainerHostPort."
+ Write-Host "Nginx configuration updated to point to green container on port $greenContainerHostPort."
nginx -t
@@ -181,37 +181,37 @@ else
Write-Host "Nginx reloaded. Successfully deployed version $version."
- Write-Host "Stopping and removing green container."
+ Write-Host "Stopping and removing blue container."
- docker stop $greenContainerId
+ docker stop $blueContainerId
if ($LASTEXITCODE -ne 0)
{
- Write-Host "Failed to stop green container."
+ Write-Host "Failed to stop blue container."
exit 1
}
- docker rm $greenContainerId
+ docker rm $blueContainerId
if ($LASTEXITCODE -ne 0)
{
- Write-Host "Failed to remove green container."
+ Write-Host "Failed to remove blue container."
exit 1
}
- Write-Host "Green container stopped and removed."
+ Write-Host "Blue container stopped and removed."
- Write-Host "Switching blue container to green container."
+ Write-Host "Switching green container to blue container."
- docker rename "blog.stevanfreeborn.com.blue" "blog.stevanfreeborn.com.green"
+ docker rename "blog.stevanfreeborn.com.green" "blog.stevanfreeborn.com.blue"
if ($LASTEXITCODE -ne 0)
{
- Write-Host "Failed to rename blue container to green container."
+ Write-Host "Failed to rename green container to blue container."
exit 1
}
Write-Host "Successfully deployed version $version."
exit 0
-}
\ No newline at end of file
+}
From 14f0d06cf48020a9712027b9694a423e2ebe7d61 Mon Sep 17 00:00:00 2001
From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com>
Date: Thu, 18 Apr 2024 22:24:12 -0500
Subject: [PATCH 2/2] post: add post about building the blog (#10)
* post: stub out initial post with outline
* fix: add title attribute to lead in feed and add disc to list styles in posts
* fix: apply style to artcile
* post: work on rough draft
* post: work on rough draft
* post: work on rought draft
* post: work on rought draft
* post: more work on rough draft
* post: finish post
* chore: cleanup usings
* chore: run dotnet format
* docs: testing README
* docs: update README.md
---
.vscode/settings.json | 7 +-
README.md | 17 +-
src/Blog/Blog.csproj | 1 -
src/Blog/Components/App.razor | 12 +-
src/Blog/Components/Pages/Post.razor | 1 -
src/Blog/Components/Posts/Feed.razor | 2 +-
src/Blog/Components/Posts/Feed.razor.css | 6 +-
src/Blog/GlobalUsings.cs | 3 +-
src/Blog/Posts/FilePostService.cs | 1 -
src/Blog/wwwroot/markdown.css | 25 +-
.../ask-internet.gif | Bin 0 -> 498902 bytes
.../index.md | 724 ++++++++++++++++++
.../loading-ui.gif | Bin 0 -> 138731 bytes
.../og-image.png | Bin 0 -> 1010930 bytes
test/Blog.Tests/EndToEnd/BlogHostFactory.cs | 8 -
test/Blog.Tests/EndToEnd/BlogTest.cs | 3 -
test/Blog.Tests/EndToEnd/RssTests.cs | 2 +-
test/Blog.Tests/GlobalUsings.cs | 3 +
test/Blog.Tests/README.md | 15 +
test/Blog.Tests/Unit/Feed.spec.razor | 3 +-
test/Blog.Tests/Unit/Footer.spec.razor | 3 +-
21 files changed, 803 insertions(+), 33 deletions(-)
create mode 100644 src/Blog/wwwroot/posts/building-a-markdown-blog-with-blazor-and-docker/ask-internet.gif
create mode 100644 src/Blog/wwwroot/posts/building-a-markdown-blog-with-blazor-and-docker/index.md
create mode 100644 src/Blog/wwwroot/posts/building-a-markdown-blog-with-blazor-and-docker/loading-ui.gif
create mode 100644 src/Blog/wwwroot/posts/building-a-markdown-blog-with-blazor-and-docker/og-image.png
create mode 100644 test/Blog.Tests/README.md
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 8e6eda8..957b20b 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,15 +1,20 @@
{
"cSpell.words": [
+ "Abramov",
"Antiforgery",
"blazor",
"Entitize",
"Hsts",
+ "interwebz",
"Markdig",
- "msedge"
+ "msedge",
+ "Squarespace",
+ "weebly"
],
"dotnet.unitTests.runSettingsPath": "./test/Blog.Tests/.runsettings",
"markdownlint.config": {
"default": true,
"MD041": false,
+ "MD048": false,
}
}
\ No newline at end of file
diff --git a/README.md b/README.md
index 7a4df74..b66838c 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,18 @@
# blog.stevanfreeborn.com
-⚠️ Under Construction ⚠️
-
The source code for [my blog](https://blog.stevanfreeborn.com).
+
+You can read more in detail about building in [this blog post](https://blog.stevanfreeborn.com/building-a-markdown-blog-with-blazor-and-docker).
+
+## Technologies and Languages Used
+
+- [C#](https://docs.microsoft.com/en-us/dotnet/csharp/)
+- [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML)
+- [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS)
+- [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
+- [Markdown](https://www.markdownguide.org/)
+- [.NET](https://dotnet.microsoft.com/)
+- [Blazor](https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor)
+- [Docker](https://www.docker.com/)
+- [Nginx](https://www.nginx.com/)
+- [GitHub Actions](https://github.com/features/actions)
diff --git a/src/Blog/Blog.csproj b/src/Blog/Blog.csproj
index 3d300cd..6de9d6a 100644
--- a/src/Blog/Blog.csproj
+++ b/src/Blog/Blog.csproj
@@ -11,7 +11,6 @@
-
diff --git a/src/Blog/Components/App.razor b/src/Blog/Components/App.razor
index 1dc87a3..9c914b6 100644
--- a/src/Blog/Components/App.razor
+++ b/src/Blog/Components/App.razor
@@ -16,12 +16,14 @@
+