An application to skewer the news you care about from across the web by loading it in the dumbest way possible.
Welcome to the Trident Application! This application is written in .NET with the goal of demonstrating all the various features and functionality in Octopus Deploy.
This application was created because I am a Utah Mammoth fan and there isn't a great website that aggregates all the articles from the various news organizations that cover the Mammoth.
Instead I'm forced to go to:
- KSL Sports
- Deseret News
- Salt Lake Tribune
- NHL
- ESPN
Most of those sites don't have great RSS support, so instead I needed a way to scrape the website for titles, images, and links. It doesn't scrape the website for article content, just links to the stories. The inspiration was 49erswebzone and how they aggregate articles about the 49ers.
This application is designed to be multi-tenanted, with a sports team being the tenant. You add a team configuration file containing websites to src/Trident.Web/wwwroot/data and set the environment variable TRIDENT_FILE_NAME to that file name. The application will read and load the news from those provided websites.
The application can run in single tenant mode. The default sports team is the Utah Mammoth.
By default the load job is disabled. You'll need to set the environment variable FeatureToggle_BackgroundSyncJob to True. Or, create an Octopus Feature Flag named BackgroundSyncJob and turn that on for the environment.
The components of this application are:
- Web front-end (single application)
- ASP.NET MVC Application
- Background job processor
- Database backend for SQL Server
The purpose of this application is to demonstrate common software delivery techniques using artifacts built by GitHub Actions and deployed via Octopus Deploy.
- Same application, multiple destinations
- Kubernetes Deployments
- Both an ARM and x86-64 container is created during the build
- The
k8sfolder contains- Helm Chart in
k8s/chart - Manifest files in
k8s/base - Kustomize overlays in
k8s/overlays - Argo CD application definitions in
k8s/argo-apps
- Helm Chart in
- Windows / Linux Deployments via a package
Trident.Web.zip
- Kubernetes Deployments
- Database Deployments using scripts found in
/src/Trident.Database.DbUp- The CLI tool uses DBUp to run migration scripts as part of the deployment.
- The CLI database deployment tool can generate an HTML report of the migration scripts that will be run.
- Multi-Tenant Deployments
- The application uses configuration files found in
src/Trident.Web/wwwroot/datato load data specific to that location. - The environment variable
TRIDENT_FILE_NAMEis used to specify a specific file on startup.
- The application uses configuration files found in
- Feature Flags
- Implements two OpenFeature providers
- Octopus Deploy when the
TRIDENT_OPEN_FEATURE_CLIENT_IDenvironment variable is set - Environment Variable Provider for testing new features locally
- Octopus Deploy when the
- See
/src/Trident.Web/Core/Configuration/TridentFeatureFlag.csfor a complete list of feature flags available
- Implements two OpenFeature providers
- Security Scanning, SBOM and Attestation verification
- Build process
- Deploy process
- You can use Trivy to scan the SBOM for any new critical vulnerabilities since the artifacts were built
- Use can use
gh attestation verifyto verify the attestations of the build artifacts
- Build information
- The GitHub action publishes build information to Octopus Deploy for the SBOM package only.
- This allows you to create release notes listing all the commits and issues included in the change.
- Ephemeral Environments
- The application is simple enough that all it needs is a database and a K8s namespace with a host name to create an ephemeral environment.
The application can run directly using the .NET runtime or as a container.
The application requires a database running on SQL Server.
- Download and install SQL Server Developer 2022+ or SQL Server Express 2022+ using one of these quick links
- Launch the .NET IDE of your choice (VS Code or Visual Studio)
- Modify the connection string in
/src/Trident.Database.DbUp/Properties/launchsettings.jsonto point to your database. - Build and Run the
/src/Trident.Database.DbUp/application in your IDE of choice.
- Modify the connection string in
- Launch the .NET IDE of your choice
- Modify the connection string in
/src/Trident.Web/Properties/launchSettings.jsonto point to your database. - Run
/src/Trident.Webapplication
- Modify the connection string in
The file /src/Trident.Web/Properties/launchSettings.json is used to control the application locally. It makes it easy to pass in environment variables that would've been passed in when launching the application in Production.
{
"profiles": {
"Trident.Web": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"TRIDENT_CONNECTION_STRING": "Server=127.0.0.1;Integrated Security=True;Database=Trident;trustServerCertificate=true;Encrypt=True;",
"TRIDENT_OPEN_FEATURE_CLIENT_ID": "blah",
"TRIDENT_FILE_NAME": "utah",
"FeatureToggle_view-feed-list": "True",
"FeatureToggle_FeatureBackgroundSyncJob": "True"
},
"applicationUrl": "https://localhost:57512;http://localhost:57513"
}
}
}- Items prefixed with
FeatureToggle_are how you can test feature toggles locally, they hae a simple setting of True or False. blahis the default values for items such as Open Feature Client Id, SumoLogic URL, and more. That phrase was chosen as it is unique and stands out.TRIDENT_FILE_NAMEindicates the configuration file to load fromsrc/Trident.Web/wwwroot/data
This application is designed for anyone to fork. Once you fork this application you'll need to set the following repository secrets for the build.yml to work correctly.
DOCKERHUB_PAT- The PAT to log into Docker HubDOCKERHUB_USERNAME- The Username to log into Docker HubOCTOPUS_OIDC_SERVICE_ACCOUNT_ID- The Service Account Unique ID to login via OIDC
You'll need to set the following repo variables for the build.yml to work correctly.
DOCKER_HUB_REPO- The dockerhub repo to push the container to, IEbobjwalker99/trident.OCTOPUS_SERVER_URL- The URL of the Octopus instance, IEhttps://bobjwalker.octopus.app.OCTOPUS_SPACE- The space name that hosts the Octopus Project, IEDefault.OCTOPUS_PROJECT_NAME- The Octopus Deploy project name, IETrident.OCTOPUS_FEATURE_BRANCH_CHANNEL- The channel to use when running the build on branches or PRs, IEBranches.OCTOPUS_RELEASE_CHANNEL- The channel to use when running the build on the main branch, IERelease.
The build.yml file expects you to have two channels in your project in Octopus Deploy.
- Default: Deploys to the
Ephemeral EnvironmentsorDevelopmentenvironment only for feature branch work - Release: Deploys to
Test->Staging->Production. This is what the main branch uses.
Please see the Contribution Guidelines on how to contribute to this project.
The Trident Application is licensed under the MIT License. See the LICENSE file for more information.
If you have any questions or feedback, please create an issue.