CI / CD Pipeline Setup

Introduction

This guide provides a detailed, step-by-step walkthrough for creating a build pipeline in Azure DevOps tailored for System1. The primary purpose of this Dev-Build Pipeline is for testing. It encompasses tasks such as compiling source code, running tests, and generating deployable artifacts.

Step 1: Task Section
  1. Get Sources

    Select the source of your project, for example, a Git repository.

  2. Agent Job - To Build, Test, and Package the Artifact

    This section orchestrates tasks to transform source code into a deployable form.

  3. Restore NuGet Packages in the Solution

    Ensure project dependencies are in place by restoring NuGet packages

  4. Build Individual Projects in the Solution

    In larger solutions, build projects independently to ensure each is ready for build without errors.

  5. Use Node 14.17.0

    Configure the Node version to be used since the agent might not have the desired version.

  6. Run [npm install] on Admin

    Install npm packages for the admin app to ensure all dependencies are available.

  7. Run [npm install] on App

    Install npm packages for the app to ensure all dependencies are available.

  8. Replace Tokens in Admin .env.production

    Replace values in the .env.production file for the admin app.

  9. Replace Tokens in App.env.production

    Replace values in the App.env.production file for the app

  10. Run [npm build] on Admin

    Build the admin app to make it ready for deployment.

  11. Run [npm build] on App

    Build the app to make it ready for deployment.

  12. Publish Web Projects to the Artifact Staging Directory

    For web apps (API, App, Admin, IdentityProvider), compile, package, and copy resulting artifacts to a staging directory.

  13. Publish Console Apps to the Artifact Staging Directory

    For console apps, compile, package, and copy resulting artifacts to a staging directory.

  14. Archive the Built-out Artifact Staging Directory

    Compress or package the contents of the staging directory into a distributable archive (e.g., zip file).

  15. Publish the Archive File

    Ensure the archived file is accessible for subsequent stages of the pipeline or other processes.

Step 2: Running the Pipeline
  1. Branch Selection

    Choose the desired branch for the build.

  2. Initiate Pipeline Run

    Run the build pipeline, triggering the defined sequence of tasks.

  3. Monitor Build Execution

    Monitor the build progress in the Build Pipelines section, reviewing details of each run and executed tasks.

  4. Review Artifacts

    Confirm that artifacts are successfully generated and stored in the specified staging directory.

  5. Pipeline Completion

    Once the pipeline run is complete, the application is in a deployable state.

This step-by-step guide ensures a systematic approach to building pipelines in Azure DevOps for System1, from source retrieval to artifact generation and pipeline execution. Adjustments and improvements can be made based on specific project requirements and evolving best practices.

Step 3: Dev-Release Pipeline - Deployment to End Users
Introduction

This section outlines the steps for releasing artifacts generated in the Dev-Build Pipeline to end users. The Dev-Release Pipeline focuses on deploying a tested and validated version of the application.

Release Pipeline Setup
  1. Use .NET Core SDK 3.1.101

    Set up the .NET version required for the release.

  2. Extract Files

    Extract artifact files generated in the Dev-Build Pipeline.

  3. API - Replace Tokens in appsettings.json

    Replace values in the appsettings.json file for the API using information stored in the Library.

  4. IDP - Replace Tokens in appsettings.json

    Replace values in the appsettings.json file for IDP using information stored in the Library.

  5. Automation - Replace Tokens in appsettings.json

    Replace values in the appsettings.json file for Automation using information stored in the Library.

  6. Admin DBUP - Replace Tokens in appsettings.json

    Replace values in the appsettings.json file for Admin DBUP using information stored in the Library.

  7. App DBUP - Replace Tokens in appsettings.json

    Replace values in the appsettings.json file for App DBUP using information stored in the Library.

  8. Identity DBUP - Replace Tokens in appsettings.json

    Replace values in the appsettings.json file for Identity DBUP using information stored in the Library.

  9. Admin DBUP Command Line Script

    Runs Admin DBUP console app to execute SQL scripts

  10. App DBUP Command Line Script

    Runs App DBUP console app to execute SQL scripts.

  11. IDP DBUP Command Line Scrip

    Runs IDP DBUP console app to execute SQL scripts.

  12. Dev SystemOne API

    Deploys the SystemOne API web app.

  13. Dev SystemOne Identity

    Deploys the SystemOne Identity Provider web app.

  14. Dev SystemOne Admin

    Deploys the SystemOne Admin web app

  15. Dev SystemOne App

    Deploys the SystemOne App web app.

  16. Dev SystemOne Automation

    Deploys the SystemOne Automation web app.