Skip to content

Commit

Permalink
updates docs
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Kononykhin <andkononykhin@gmail.com>
  • Loading branch information
andkononykhin committed Mar 27, 2019
1 parent 5311803 commit 4fc29e0
Showing 1 changed file with 44 additions and 42 deletions.
86 changes: 44 additions & 42 deletions docs/source/ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

- `master` branch contains the latest changes. All PRs usually need to be sent to master.
- `stable` branch contains latest releases (https://github.com/hyperledger/indy-node/releases). Hotfixes need to be sent to both stable and master.
- `release-*` branches holds release candidates during release workflow
- `hotfix-*` branches holds release candidates during hotfix workflow
- `release-*` branches hold release candidates during release workflow
- `hotfix-*` branches hold release candidates during hotfix workflow

#### Pull Requests

Expand All @@ -19,7 +19,7 @@
- Unit/Integration tests
- We use pipeline in code approach and Jenkins as our main CI/CD server.
- CI part of the pipeline (running tests for each PR) is defined in `Jenkinsfile.ci` file.
- CI part is run on Hyperledger Jenkins, so it is public and open as every contributor needs to see results of the tests run for his or her PR.
- CI part is run on Hyperledger and Sovrin Foundation Jenkins servers, so they are public and open as every contributor needs to see results of the tests run for his or her PR.

#### Static Code Validation

Expand All @@ -34,7 +34,7 @@
## Continuous Delivery

- CD part of the pipeline is defined in `Jenkinsfile.cd` file.
- CD part is run on a private Jenkins server dealing with issuing and uploading new builds.
- CD part is run on Sovrin Foundation Jenkins server dealing with issuing and uploading new builds.

#### Builds

Expand All @@ -46,33 +46,33 @@ What artifacts are produced after each push
- indy-plenum deb package in [`https://repo.sovrin.org/deb xenial master-latest`](https://repo.sovrin.org/lib/apt/xenial/master-latest/)
- indy-node:
- indy-node in [pypi](https://pypi.python.org/pypi/indy-node)
- indy-node deb package in [`https://repo.sovrin.org/deb xenial master`](https://repo.sovrin.org/lib/apt/xenial/master-latest/)
- indy-node deb package in [`https://repo.sovrin.org/deb xenial master`](https://repo.sovrin.org/lib/apt/xenial/master/)
- indy-plenum deb package in [`https://repo.sovrin.org/deb xenial master`](https://repo.sovrin.org/lib/apt/xenial/master/) (copied from master-latest)
- indy-node deb package in [`https://repo.sovrin.org/deb xenial master-latest`](https://repo.sovrin.org/lib/apt/xenial/master-latest/)
- indy-node deb package in [`https://repo.sovrin.org/deb xenial master`](https://repo.sovrin.org/lib/apt/xenial/master/) (copied from `master-latest`)
- indy-plenum deb package in [`https://repo.sovrin.org/deb xenial master`](https://repo.sovrin.org/lib/apt/xenial/master/) (copied from `master-latest`)
- to `release-*` and `hotfix-*` branches:
- all artifacts include pre-release segment `rcN` in their version
- indy-plenum:
- indy-plenum in [pypi](https://pypi.python.org/pypi/indy-plenum)
- indy-plenum deb package in [`https://repo.sovrin.org/deb xenial rc-latest`](https://repo.sovrin.org/lib/apt/xenial/rc-latest/)
- indy-node:
- indy-node in [pypi](https://pypi.python.org/pypi/indy-node)
- indy-node deb package in [`https://repo.sovrin.org/deb xenial rc`](https://repo.sovrin.org/lib/apt/xenial/rc-latest/)
- indy-node deb package in [`https://repo.sovrin.org/deb xenial rc`](https://repo.sovrin.org/lib/apt/xenial/rc/)
- indy-plenum deb package in [`https://repo.sovrin.org/deb xenial rc`](https://repo.sovrin.org/lib/apt/xenial/rc/) (copied from rc-latest)
- indy-node deb package in [`https://repo.sovrin.org/deb xenial rc-latest`](https://repo.sovrin.org/lib/apt/xenial/rc-latest/)
- indy-node deb package in [`https://repo.sovrin.org/deb xenial rc`](https://repo.sovrin.org/lib/apt/xenial/rc/) (copied from `rc-latest`)
- indy-plenum deb package in [`https://repo.sovrin.org/deb xenial rc`](https://repo.sovrin.org/lib/apt/xenial/rc/) (copied from `rc-latest`)
- to `stable` branch:
- indy-plenum:
- indy-plenum in [pypi](https://pypi.python.org/pypi/indy-plenum)
- indy-plenum deb package in [`https://repo.sovrin.org/deb xenial stable-latest`](https://repo.sovrin.org/lib/apt/xenial/stable-latest/)
- indy-plenum release tag (https://github.com/hyperledger/indy-plenum/releases)
- indy-node:
- indy-node in [pypi](https://pypi.python.org/pypi/indy-node)
- indy-node deb package in [`https://repo.sovrin.org/deb xenial stable`](https://repo.sovrin.org/lib/apt/xenial/stable-latest/)
- indy-node deb package in [`https://repo.sovrin.org/deb xenial stable`](https://repo.sovrin.org/lib/apt/xenial/stable/)
- indy-plenum deb package in [`https://repo.sovrin.org/deb xenial stable`](https://repo.sovrin.org/lib/apt/xenial/stable/) (copied from stable-latest)
- indy-node deb package in [`https://repo.sovrin.org/deb xenial stable-latest`](https://repo.sovrin.org/lib/apt/xenial/stable-latest/) (re-packed from `rc-latest`)
- indy-node deb package in [`https://repo.sovrin.org/deb xenial stable`](https://repo.sovrin.org/lib/apt/xenial/stable/) (copied from `rc-latest`)
- indy-plenum deb package in [`https://repo.sovrin.org/deb xenial stable`](https://repo.sovrin.org/lib/apt/xenial/stable/) (copied from `stable-latest`)
- indy-node release tag (https://github.com/hyperledger/indy-node/releases)

Use cases for artifacts
- Pypi artifacts can be used for dev experiments, but not intended to be used for production.
- Pypi artifacts can be used for development experiments, but not intended to be used for production.
- Using deb packages is recommended way to be used for a test/production pool on Ubuntu.
- indy-node deb package from [`https://repo.sovrin.org/deb xenial stable`](https://repo.sovrin.org/lib/apt/xenial/stable/)
is one and the only official stable release that can be used for production (stable version).
Expand All @@ -99,18 +99,16 @@ Each `build-scripts` folder includes `Readme.md`. Please check them for more det

#### Versioning

- Please note, that we are using versioning that satisfies [PEP 440](https://www.python.org/dev/peps/pep-0440) with release segment as MAJOR.MINOR.PATCH that satisfies [SemVer](https://semver.org/) as well.
- Please note, that we are using versioning that satisfies [PEP 440](https://www.python.org/dev/peps/pep-0440) with release segment as `MAJOR.MINOR.PATCH` that satisfies [SemVer](https://semver.org/) as well.
- Version is set in the code (see [\_\_version\_\_.json](https://github.com/hyperledger/indy-node/blob/master/indy_node/__version__.json)).
- Version is bumped for new releases / hotfixes either manually or using [bump_version.sh](https://github.com/hyperledger/indy-node/blob/master/indy_node/bump_version.sh) script. The latter is preferred.
- During development phase version includes developmental segment `devN`, where `N` is set for CD pipeline artifacts as incremented build number of build server jobs. In the source code it is just equal to `0` always.
- During release preparation (release / hotfix workflows) phase version includes pre-release segment `rcN`, where `N>=1` and set in the source code by developers.
- During release preparation phase (release / hotfix workflows) version includes pre-release segment `rcN`, where `N>=1` and set in the source code by developers.
- Each dependency (including indy-plenum) has a strict version (see [setup.py](https://github.com/hyperledger/indy-node/blob/master/setup.py))
- If you install indy-node (either from pypi, or from deb package), the specified in setup.py version of indy-plenum is installed.
- Master and Stable share the same versioning scheme.
- Differences in master and stable code:
- `setup.py`:
- dev suffix in project names and indy-plenum dependency in master; no suffixes in stable
- different versions of indy-plenum dependency
- `setup.py`: different versions of indy-plenum dependency
- different versions in migrations scripts


Expand All @@ -127,28 +125,32 @@ Each `build-scripts` folder includes `Readme.md`. Please check them for more det
- different versions of indy-plenum dependency
- different versions in migrations scripts

## How to Create a Stable Release

# indy-plenum
- [Maintainer] Creates a new release branch `release-X.Y.0` based on `stable` in `hyperledger/indy-plenum`, where `X.Y.0` is coming release version.
- [Any contributor] Creates a new release candidate branch (e.g. `X.Y.0.rc1`) based on that release branch. And commits usually the following:
- Merge `master` branch
- Sets new versions `X.Y.0.rc1`
- Creates a release candidate PR to `release-X.Y.0`.
- [Maintainer] Reviews the PR and either merges the PR or asks for changes.
- Once the PR is merged CD pipeline is triggered for branch `release-X.Y.0` and it does the following:
- creates release commit
- publish release candidates packages
- creates PR to merge `release-X.Y.0` to `stable`
- Once PR is approved and pipeline is approved to proceed it performs fast-forward merging to stable and creates tag `vX.Y.0`.
- In case of rejection from Maintainer / QA pipeline stops and new release candidate branch (e.g. `X.Y.0.rc2` should be prepared as PR to `release-X.Y.0`. Previous steps are repeated for that release candidate and possible future ones.
## Release workflow

1. [Maintainer] Creates a new release branch `release-X.Y.0` based on `stable`
2. [Contributor]
- creates a new release candidate branch (e.g. `rc-X.Y.0.rc1`) based on that release branch
- merge `master` branch
- set new versions `X.Y.0.rc1` (`./bump_version.sh X.Y.0.rc1`)
- commits and pushes changes
- creates a release candidate PR to `release-X.Y.0`
3. [Maintainer] Waits for CI, reviews the PR and either merges the PR or asks for changes.
4. [build server] Once the PR is merged CD pipeline is triggered for branch `release-X.Y.0` and it does the following:
- creates and pushes release commit to `release-X.Y.0`
- publish release candidates packages
- performs system testing (`indy-node` only)
- creates PR to merge `release-X.Y.0` to `stable`
- waits for approval to proceed
5. [Maintainer/QA] Waits for CI, reviews the PR and either approves or rejects:
- in case of approval it also lets build server to proceed
- otherwise stops the pipeline and previous steps are repeated for new release candidate `X.Y.0.rc1` and possible future ones
6. [build server]
- once it is approved to proceed performs fast-forward merging to stable and creates tag `vX.Y.0`.
- otherwise rollbacks release commit pushed to release branch `release-X.Y.0`
7. [build server] Once release PR is merged stable pipeline is triggered and it:
- publishes to Pypi
- re-packs rc debian package and publishes to debian stable components

Hotfix releases are quite similar except the following difference:
- hotifx branches `hotfix-X.Y.Z` are created from tags `vX.Y.(Z-1)`
- `master` is not merged since hotfixes should include only fixes for stable code

# indy-node

Release logic is similar to one described for `indy-plenum` with some additions:
- CD pipeline performs system testing
- Once they passed it waits for approval from QA who tests this release candidate from [https://repo.sovrin.org/deb xenial rc](https://repo.sovrin.org/lib/apt/xenial/rc/))
- hotifx branches `hotfix-X.Y.Z` are created from git tag `vX.Y.(Z-1)`
- `master` is not merged since hotfixes (as a rule) should include only fixes for stable code

0 comments on commit 4fc29e0

Please sign in to comment.