Skip to content

dawitanelay/BoschAI-Ensuring-Quality-Releases

 
 

Repository files navigation

Architectural Diagram

alt text

Dependencies

  1. Azure DevOps
  2. Install latest version Terraform
  3. Install latest version JMeter
  4. Install latest version Postman
  5. Install latest version Selenium
  6. Python
  7. Install latest version Azure command line interface

Getting Started

1 Clone this repository

2 Login into your azure account: az login -u "username" -p "password"

3 Create service principal or use the one you already have:

4 cd /terraform/environments/test && bash configure-tfstate-storage-account.sh

5 Make an azureCredentials.conf file that contains variables to be uploaded and used as group variables in pipline. The file looks like this:

storage_account_name = "tfstate1216731519"
container_name       = "tfstate"
key                  = "terraform.tfstate"
access_key           = "fdHvTyBUbM/QQq8MXDfezwsQQqVBXg7xZF4pSc0gAXnAzNb7djPd0gA+0LLQCNkPa2QQiXBlnkzB+ASt9z9jnQ=="

Azure subscription vars
subscription_id = "ae905fde-e5ea-40f0-a6db-35397678cc4c"
client_id = "5e3a010b-f12a-4b7b-8c84-63101995f0e3"
client_secret = "-w18Q~iUxAOS2ly-YJUD7MeItyTXQ-e5l1V8Xc1Q"
tenant_id = "f958e84a-92b8-439f-a62d-4f45996b6d07"

6 Create ssh key

 ssh-keygen -t rsa 

7 Update the following fields in main.tf and/or terraform.tfvars file.

parameter Link
subscription_id subscription id
client_id service principal client app id
client_secret service principal password
tenant_id service principal tenandt id
location location
resource_group Resource Group
application_type Name of the APP - must be unique
virtual_network_name Name of the VNet
public_key_path path of the id_rsa.pub file

8 Login to azure DevOps organization.

9 Create a service connection

10 Create self-host Agent Pool: Follow the step Azure pipeline agent Here

11 Install the following on the Agent pool

sudo apt-get -y install zip 
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash 
sudo apt-get install npm 

12 Create a new pipeline.

  • Select you GitHub repository.
  • Select azure pipelines YAML file

13 Create a new environment.

environment

14 From the environment select the VM created from terraform apply. Log into the VM with and paste the registration script

 ssh username@publicIP 

15 From Pipeline create a variable group and upload the file  variable group

16 Run the pipeline.

  • Successful pipeline run

 stage

Output

Build Infrastructure

Terraform output

Automated Testing

Jmeter

1 Endurance Testing

 stage

2  stage

Postman

Regression test  stage

Validation test  stage Publish test result

 stage

 stage

Selenium

 stage

Monitoring & Observability

Create alart

Copy the app service url and https://udacity-appservice.azurewebsites.net/jyt. This will create a 404 error and triger the email.  stage  stage

Set up log analytics workspace properly to get logs: Go to Virtual Machines and Connect the VM created on Terraform to the Workspace.

Set up custom logging , in the log analytics workspace go to. In this case custom log name is seleniumUI_CL.

Custom Logs > Add + > Choose File. Select the file selenium-test.log > Next > Put in the following paths as type Linux: /var/log/selenium/selenium-test.log.

 stage

Go to Log Analytics Workspace , to run the following queries:

AppServiceHTTPLogs |where _SubscriptionId contains "sub_id" | where ScStatus == '404'

 stage

About

Azure CI/CD Pipelines, Terraform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 36.5%
  • HTML 33.9%
  • HCL 17.0%
  • Python 5.4%
  • CSS 5.2%
  • Shell 1.8%
  • ASP.NET 0.2%