CurlyBytes / azure-devops-ubp

Node.js Demo Application for use in Azure Demos

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overview

This demo application was created to showcase the concept of adding automated performance quality gates using Keptn Pitometer

Once provisioned, the sample nodejs application will look like this for both a "staging" and "production" webapp intances.

Folders and files

  1. root folder and img/ - location of demo app.js nodejs demo application
  2. perfspec/ - folder containing sample perfspec file
  3. pipeline/ - folder containing scripts that can be used in DevOps pipelines
  4. arm/ - folder containing scripts and templates to provision demo Azure resources

Provision Azure resources

More details here

Azure DevOps pipelines

  1. azure-pipelines.yml - this pipeline will build a zip artifact that is used to deploy to a staging and production web app. A dyntrace deployment event is done for both. A call to a pitometer web service acts as a quality gate to production
  2. azure-pipelines-create-resources.yml - this pipeline is be run one-time as to setup the envionment. This will just call arm/provision.sh
  3. azure-pipelines-delete-resources.yml - this pipeline is be run one-time as to delete the envionment. This will just call arm/remove.sh

Required Pipeline variables

  • app-problem-number = value from 1 to 4
  • azure-location = value such as 'East US'
  • azure-location-code = value such as 'eastus'
  • azure-resource-prefix = use your last name such as 'smith'
  • azure-subscription-name = use name of your Azure subscription such as 'My account'
  • dynatrace-api-token = generated value from your environment
  • dynatrace-base-url = value such as 'https://.live.dynatrace.com'
  • dynatrace-environment-id = value such as gan12345
  • dynatrace-paas-token = generated value from your environment
  • loadtest-duration-seconds = number value such as 300 (5 minutes)
  • pitometer-image = docker image. Use pre-build image of 'robjahn/pitometer-web-service'
  • pitometer-url = url to your azure container app such as 'http://:8080/api/pitometer'
  • quality-gate-status-override = value of 'pass' or 'fail'

Recommend creating a 'Variable Group'

then linking the variable group to each pipeline

Local development

  1. You must have node installed locally.
  2. Once you clone the repo, you need to run npm install to download the required modules
  3. run npm update
  4. run npm start
  5. access the application @ http://127.0.0.1:8080/

About

Node.js Demo Application for use in Azure Demos


Languages

Language:Shell 38.1%Language:JavaScript 32.4%Language:HTML 19.8%Language:PowerShell 9.7%