Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Documentation] Release and Deployment Strategy #79

Closed
8 tasks done
Tracked by #81 ...
TanmoySG opened this issue Apr 7, 2022 · 9 comments · Fixed by #89
Closed
8 tasks done
Tracked by #81 ...

[Documentation] Release and Deployment Strategy #79

TanmoySG opened this issue Apr 7, 2022 · 9 comments · Fixed by #89
Assignees
Labels
architecture | design Architectural and System Design Exploration and Planning for the System deployment Deployment Activities documentation Improvements or additions to documentation

Comments

@TanmoySG
Copy link
Owner

TanmoySG commented Apr 7, 2022

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 -

  • Automated GitHub Releases on Git Version Tagging
  • Automated Dockerization and Deployment to GitHub Packages for Containers
  • Deployment to Azure (this will be deprecated/torndown Soon)

[Checkpoints]

  • Plan out a deployment strategy
  • Integrate GitHub Release, Publishing Docker Container to GitHub Package Registry
  • Integrate Azure Deployment - Replace Existing Workflow
  • Create Workflows using GitHub Actions
  • Test Strategies - Compare and Decide
  • Publish v0.1.0-alpha , First Release with the Workflow.

[Issues]

[JFYI]

Versioning

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

Major.Minor.Patch-target

In the Above

  • Major - Major Feature Additions, Breaking API Changes and other Major Changes that can effect the dependant systems.
  • Minor - Minor Feature Additions, Backward Compatible, Usage Experience Enhancements and Minor Changes.
  • Patch - Bug Fixes, Backward Compatible and Enhancement Fixes and Changes.
  • target - Build Targets (OS Specific/OS Version Specific/Architecture Specific Targets) or pre-releases (beta/alpha) or audience/user Targets (general/Pro/internal/etc.)

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 TanmoySG added documentation Improvements or additions to documentation architecture | design Architectural and System Design Exploration and Planning for the System labels Apr 7, 2022
@TanmoySG TanmoySG self-assigned this Apr 7, 2022
@TanmoySG TanmoySG added this to To do in wunder Identity Provider v0.1.0 via automation Apr 7, 2022
@TanmoySG
Copy link
Owner Author

TanmoySG commented Apr 7, 2022

Strategy A

There are two Artefact Build Workflows required

  • Release Artefacts
  • Containerization Artefact

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
Copy link
Owner Author

TanmoySG commented Apr 7, 2022

Strategy B

There are two Artefact Build Workflows required

  • Release Artefacts
  • Containerization Artefact

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
Copy link
Owner Author

TanmoySG commented Apr 7, 2022

Updates

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

@TanmoySG
Copy link
Owner Author

TanmoySG commented Apr 7, 2022

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
Copy link
Owner Author

TanmoySG commented Apr 8, 2022

How to - Deployment using Git

Currently there are 3 Branches being maintained

  • main
  • deploy - for Azure Deployment Pipelines
  • dev - for development

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

  • All Changes to code, work on new features, bug fixes are to be done in separate branches, preferably dev.
  • The code changes are merged from development branches to main either periodically or on feature maturation.
  • Commit Changes to the dev branch, raise a Pull Request, review changes, test changes, merge the PR to main.
  • Release Candidates/Deploy-ready Code are to be published only from the main branch.

When the Code is tested, and fit for Release

  • In the Editor (Codespaces/VS Code) move from the dev branch to the main branch using git checkout.
git checkout main
  • From the main branch, tag the code using git tag. Use the main branch-name following the tag name so as to ensure tag points to the latest commit on the main branch and hence the tag refers to production ready code on main branch.
git tag v1.2.34-alpha main
  • Sync the tags to remote (GitHub)
git push --tags

This should trigger the Deployment Workflows and create a Release and a Container is Published.

Deployment Strategy-How to - Strategy

Note

  • Tags are to be added only from the main branch.
  • A Release Candidate must be tagged from the main branch before making any commits to other branches. The latest commit on Main Branch should be tagged and only then should any changes be committed to other branches.
  • Not all Merge needs to be followed by tagging.
  • Only Tested and Stable Release candidates should be tagged.
  • Versions should be according to the versioning guide (above).

@TanmoySG
Copy link
Owner Author

TanmoySG commented Apr 9, 2022

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
Copy link
Owner Author

TanmoySG commented Apr 9, 2022

Testing Workflows

image

@TanmoySG
Copy link
Owner Author

Published v0.1.1-alpha!

Published tag v0.1.0-alpha of wIP.

  • Release Workflow published the v0.1.0-alpha build
  • Container Published on GitHub Package Registry

image

@TanmoySG
Copy link
Owner Author

How is the Code Structured ?

Code-Diagram (1)

wunder Identity Provider v0.1.0 automation moved this from In progress to Done Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture | design Architectural and System Design Exploration and Planning for the System deployment Deployment Activities documentation Improvements or additions to documentation
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant