TanmoySG / wunder-identity-provider

ID Provider for Wunder Platform. Authentication & Authorization Server for all wunder products
3 stars 0 forks source link

[Documentation] Release and Deployment Strategy #79

Closed TanmoySG closed 2 years ago

TanmoySG commented 2 years ago

A Release and Deploy Strategy is an essential part of Software Delivery Workflow. Not all Commits need to make it to deployment or release. A versioning system is also a cornerstone of this workflow. Hence a strategic approach is required to keep commits and deployment workflows separate. Currently, on a commit to the deploy branch triggers the deployment to Azure which is fine till a separate feature branch exists, but maintaining separate feature branches get tougher with project growing, hence thus Workflow too needs to be triggered only by specific actions like a version tagging or release.

There are three deployments that are to be put into this strategy -

[Checkpoints]

[Issues]

[JFYI]

Versioning

A proper versioning system that should be used in this project is

Major.Minor.Patch-target

In the Above

Refer to semver.org or versioning section in notes

Adopted Strategy

Strategy B, triggers builds/workflows only if the version tagged and committed is a Major or Minor Update as well as Patch updates - so that both Feature-Ready/Feature-full releases and Bug Fixes are published to the artefacts.

On the other hand this strategy may also lead to frequent adoption changes on the user end.

Strategy B

Deployment Strategy-Strategy B (1)

TanmoySG commented 2 years ago

Strategy A

There are two Artefact Build Workflows required

And a Deployment to Azure Worflow, that will be torndown soon.

Apart from building these artefacts, they are required to be published to GitHub Package Registry and GitHub Releases as well.

There is a requirement for an Automated Workflow - using GitHub Actions - for building and Publishing these. These workflows are to triggered only on specific and special commits like version tagging using git tag. Not all commits or even versioning should trigger these.

Plan and Observations

This, Strategy A, triggers builds/workflows only if the version tagged and committed is a Major or Minor Update - so that only Feature-Ready/Feature-full releases are published.

On the other hand this strategy may also lead to Bug Fixes and Enhancements to be skipped for a long time until a Minor or Major Release Candidate is not Ready.

Deployment Strategy-Strategy A

TanmoySG commented 2 years ago

Strategy B

There are two Artefact Build Workflows required

And a Deployment to Azure Worflow, that will be torndown soon.

Apart from building these artefacts, they are required to be published to GitHub Package Registry and GitHub Releases as well.

There is a requirement for an Automated Workflow - using GitHub Actions - for building and Publishing these. These workflows are to triggered only on specific and special commits like version tagging using git tag. Not all commits or even versioning should trigger these.

Plan and Observations

This, Strategy B, triggers builds/workflows only if the version tagged and committed is a Major or Minor Update as well as Patch updates - so that both Feature-Ready/Feature-full releases and Bug Fixes are published to the artefacts.

On the other hand this strategy may also lead to frequent adoption changes on the user end.

Deployment Strategy-Strategy B (1)

TanmoySG commented 2 years ago

Updates

Currently using dockerize-flask-test repo to test the Strategy in Action.

TanmoySG commented 2 years ago

Creating a Tag using git

To create a Tag use the git tag command as,

git tag <tag-name>

The tag-name can be the version. You may also create an "annotated tag" using -a flag and a tagging message following the -m flag.

git tag -a v1.4 -m "my version 1.4"

List the tags

git tag

Pushing tags to GitHub or Remote Origin

Push the Tags to remote origin/repo

git push --tags

Learn More at git-scm.com.

TanmoySG commented 2 years ago

How to - Deployment using Git

Currently there are 3 Branches being maintained

Code changes are made in the dev branch and merged to main - either periodically to sync code or to sync feature-complete code to main.

Framework to Commit, Merge and Tag Code

When the Code is tested, and fit for Release

Deployment Strategy-How to - Strategy

Note

TanmoySG commented 2 years ago

Working with Git Tags

Git tags point to the HEAD (latest commit) in the git tree, when no branch is specified. Hence if a tag is created it points to the latest commit (HEAD) in the tree irrespective of the branch.

git tag v1.2.3

To Specify the Target Branch use the branch name in the git tag command

git tag v1.2.3 branch_name

Now the version v1.2.3 will point to the latest commit in the branch specified instead of the HEAD.

Here's a detailed working of git tags on stackoverflow.

TanmoySG commented 2 years ago

Testing Workflows

image

TanmoySG commented 2 years ago

Published v0.1.1-alpha!

Published tag v0.1.0-alpha of wIP.

image
TanmoySG commented 2 years ago

How is the Code Structured ?

Code-Diagram (1)