Skip to content

This project is intended to be used as a scaffolding to perform both Continuous Integration and Continuous Delivery

Notifications You must be signed in to change notification settings

moascode/azure-build-ci-cd-pipeline

Repository files navigation

Python application test with Github Actions

Azure DevOps: Building a CI/CD Pipeline

Overview

This project is intended to be used as a scaffolding to perform both Continuous Integration and Continuous Delivery by using Github actions and Azure pipeline.

Project Details

Quarterly Project Plan: quarterly and yearly goal with weekly task estimation

Task Tracking: trello board which shows project progress

Demo: project demo which explains how to build CI/CD pipeline using Github actions and Azure pipeline

Prerequisites

Architectural Diagram

Project Architecture

Instructions

1. Setup development environment

1.1 Clone and build the application inside of Azure Cloud Shell

  • Generate SSH key ssh-keygen -t rsa in cloud shell and add it to Github Repository

  • Clone Github Repository

    Repo Clone

  • Create and activate virtual environemnt

    python3 -m venv venv
    source venv/bin/activate
    

1.2 Run local test

  • Run make all command in azure shell

    Test Passed

2. Configure Continious Integration on Github

2.1 Run remote test on Github SaaS server

  • pythonapp.yml contains GitHub Actions which will be triggered by any change in the repo

    Github Build

3. Configure Continious Delivery on Azure

3.1 Create azure webapp in azure cloud shell

  • Command to create webapp

    az webapp up -n helloflaskmoascode -g azuredevops -l southeastasia --sku F1

  • Verify webapp in azure ui

    Webapp Running

3.2 Deploy the application using Azure Pipelines into Azure App Services

  • Build and deployment stages in Azure pipeline

    Webapp Running

  • Verify Webapp deployment config

    Webapp Running

  • Verify with web url

    Web url

  • Verify with a successful prediction in Azure Cloud Shell

    Prediction

  • Verify with logs in the cloud shell using az webapp log tail

    Log CLI

  • Verify with logs in the portal

    Log Portal

3.1 Load test an application using Locust

  • Test from azure cli

locust -f locustfile.py --host https://helloflaskmoascode.azurewebsites.net/ --headless -u 20 -r 5 -t 20s

Locust CLI

  • Test from web

    Locust web

Enhancements

  • Automate all manual process
  • Setup pipelines for multiple environments (dev, test, staging)

About

This project is intended to be used as a scaffolding to perform both Continuous Integration and Continuous Delivery

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published