Skip to main content

An Azure DevOps cli tool

Project description

AzDevOps CLI

License: MIT Pypi

I.Continuous integration

Branch Build Quality Gate
main Build Status
develop Build Status

II.Introduction

This project is used to update all selected repositories in one single script define by a config.yml file. The python script will automatically clone the repositories, modify it and propose a pull request on each repository inside Azure DevOps.

III. Getting Started

Create a dev environment for the project:

python3 -m venv .venv

Activate the dev environment:

source .venv/bin/activate

Install python packages for the project:

pip install -r requirements.txt

Save the packages used in the project into the requirements.txt:

pip freeze > requirements.txt

Export credentials as environment variable to be able to run the API calls:

export AZDEVOPS_ORGANIZATION_URL='<your_azure_devops_organisation_url>'
export AZDEVOPS_PAT_TOKEN='<your_pat>'

IV - Models generation

Transform the config.yml into json with this website for instance: https://jsonformatter.org/yaml-to-json

Then copy the generated json and paste it inside this other website: https://app.quicktype.io/

Choose default settings with the Python language.

V - Install locally for testing only

python3 -m pip install --editable .

VI - Run the CLI

azdevops repo-updater run --configuration-file <path-to>/config.yml -o <output-path>
azdevops release-manager changelog -p <your-project-path> -o <output-path>

VII - Unit tests

Run unit tests:

python3 -m unittest

or

coverage run -m unittest discover

Generate covrage locally

coverage report

Generate a changelog

azdevops release-manager changelog (-p <project-path>) (-o <output>)

Using Docker:

docker run -v $(Build.SourcesDirectory):/app \ 
           -t aichehda/azdevops-cli:latest \
                   release-manager changelog \
                   (-p <project-path>) \
                   (-o <output>) \

Generate a summary

azdevops release-manager summary -pn <project-name> (-r <regex>)

azdevops release-manager summary -pn 'MyProject' -r '^digital(.*)_apply'

Using Docker:

docker run -v $(Build.SourcesDirectory):/app \ 
           -e AZDEVOPS_ORGANIZATION_URL=$AZDEVOPS_ORGANIZATION_URL \
           -e AZDEVOPS_PAT_TOKEN=$AZDEVOPS_PAT_TOKEN \
           -t aichehda/azdevops-cli:latest \
                   release-manager summary \
                   -r '^digital(.*)_apply' \
                   -pn MyProject \
                   (-p <project-path>) \
                   (-o <output>) \

Generate manifest

azdevops release-manager manifest -an <application-name>

Using Docker on Azure DevOps:

docker run  -v $(Build.SourcesDirectory):/app \
                -e BUILD_DEFINITIONNAME=$BUILD_DEFINITIONNAME \
                -e BUILD_BUILDID=$BUILD_BUILDID \
                -e BUILD_BUILDNUMBER=$BUILD_BUILDNUMBER \
                -e BUILD_SOURCEBRANCHNAME=$BUILD_SOURCEBRANCHNAME \
                -e BUILD_REPOSITORY_NAME=$BUILD_REPOSITORY_NAME \
                -t aichehda/azdevops-cli:latest \
                        release-manager manifest \
                        -an my_app
                        (-p <project-path>) \
                        (-o <output>) \

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

azdevops_cli-0.2.0-py3-none-any.whl (35.7 kB view details)

Uploaded Python 3

File details

Details for the file azdevops_cli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: azdevops_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 35.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.15

File hashes

Hashes for azdevops_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32e2c3c9f004bec888c7feb4d4d7e4de90041f70c0d391f63f12c2e2db9cf9a1
MD5 a4359c9682099793c5a246863179d1c7
BLAKE2b-256 8dde341a9e1d1c12c92945ab2ee66845635b7b2c0efea310213f42c3506aa9e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page