Giter Club home page Giter Club logo

common-pipelines's Introduction

Introduction

Reusable YAML for azure devops. To use these you can fork this repository and use the following on your YAML code to reference the template file:

resources:
  repositories:
    - repository: templates
      type: github
      name: <username>/Common-Pipelines
      endpoint: <your endpoint setup from devops>

Currently available templates:

netcore-ubuntu

This is meant to deploy a .NET Core web app (excluding blazor WASM) to any Ubuntu VM that is setup with Nginx.

  1. Make sure you have followed this official documentaiton to setup Nginx http://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-3.1. You can skip the parts to setup the Linux service (covered under the Monitor the app section) using the .service file and to upload the binaries, since this template would take care of those.

  2. As of now, this template assumes you have a virtual machine called "websites" under an environment called "Development". However, this is soon to change. For now. this can be setup by going under Pipelines > Environments in azure devops. Select "New Environment". Enter the name as "Development" and choose the Resource as a linux virtual machine. Follow the instructions and copy-paste the command line arguement provided in your linux VM. Make sure the VM is named "websites".

  3. Once the above is setup, you can use a YAML similar to the below. Make sure you replace everything within the <> including the those symbols

pool:
  vmImage: 'ubuntu-latest'

resources:
  repositories:
    - repository: templates
      type: github
      name: <username>/Common-Pipelines
      endpoint: <your endpoint setup from devops>


extends:
  template: Shared\netcore-ubuntu.yml@templates
  parameters:
    usePreRelease: <true if you want to use .net 5 prereleases>
    projectPath: <path to the web app to deploy>
    projectName: <a unique project name>
    destDirectory: <destination directory where code is deployed>
    port: <port specified in NGINX for the webapp. default is 5000>

    service:
      description: <description for your .service file>
      identifier: <unique identifier for your .service file>
      name: <name for you .service file>
    configs:
     # add all configurations for your web app. Below are two examples
     # the second is how secrets such as connection strings can be added. 
     # read this for more information on secret variables: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#secret-variables
      ASPNETCORE_ENVIRONMENT: Production
      connectionStrings__db: $(Secrets.Db)
    preBuildSteps:

    # following are optional pre-conditions before the deployment process. 
    # this can be used to run tests. below is an example
      - script: dotnet test myproject.Tests
        displayName: Unit Tests

common-pipelines's People

Contributors

neville-nazerane avatar

Watchers

James Cloos avatar Rafsanul Hasan avatar  avatar  avatar

Forkers

rafsanulhasan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.