- PR means BitBucket's pull request.
- Version suffixes, like
-SNAPSHOTor-RCor-buildare not used. - Git must be installed and be in the PATH.
- Git tag format must be only version number. Any prefixes or suffixes are not allowerd.
- Developer must start from
masterbranch. - Developer must work on
featurebranch.- The name of the branch must be short, yet must describe the purpose of the changes.
- Multiple words must be separated with hyphen, not underscore.
- Developer must commit a
/.version.bumpfile.- File must contain one of 3 words,
major,minororpatch, to indicate which version should be bumped.
- File must contain one of 3 words,
- Developer must checkout
release_UNIQUE_IDbranch from latest availablemasterbranch. This step should be done immediately before PR creation. Possibly, script should exist in project's directory to complete this step with as few manual steps as possible.- Id should be unique, yet able to generate in deterministic manner as it will be used multiple times in independent pipeline steps.
- Developer must create PR from
mastertorelease_UNIQUE_IDbranch. For the sake of simplicity let's assume feature is implemented properly and PR has got accepted. - Developer must merge PR which will merge and push to
release_UNIQUE_IDbranch. - On push to
release_UNIQUE_IDthe following steps must be executed by CI.- Script must check if
/.version.bumpexists. If not, job must fail. - Script must get the current version number from
/.versionfile. If file doesn't exist, current version must be0.0.1. If can't be read, job must fail. - Script must generate new version number using
/.version.bumpfile content.- If current version is
0.0.1, file's content must not bepatch. If it is, job must fail. A0.0.1is not allowed in SemVer but after major or minor increase it becomes1.0.0or0.1.0, respectively, which are allowed. - If file's content is
major, increase major number and reset minor and patch numbers to zero. - If file's content is
minor, do not change major number, increase minor number, and reset patch number to zero. - If file's content is
patch, do not change major and minor numbers and increase patch number.
- If current version is
- Script must update version number to new one in
/readme.mdfile. - Script must update
/changelog.mdfile (See: Keep a changelog for the spec.) If file doesn't exist, can't be read, job must fail.- Script must change 'Unreleased' section title with new version and today's date. If section doesn't exist, job must fail.
- Script must add reference URL in the bottom, to have a new version pointing to changes between new and previous version.
- Script must write new version to
/.versionfile overwriting existing file. Create file if not exists. - Script must delete
/.version.bumpfile. - Script must commit changes with message
Bump version to NEW_VERSION. WhereNEW_VERSIONis new version number. - Script must set Git tag with new version.
- Script must merge
release_UNIQUE_IDtomasterbranch. If fails, job must fail. - Script must push
masterbranch. If fails, job must fail. - Script must delete
release_UNIQUE_IDbranch. If fails, job must display warning.
- Script must check if
- On push to
masterthe following steps must be executed by CI.- Script must check if
/.version.bumpexists. If yes, job must fail. - Script must get version from
/.versionfile. If file doesn't exists or can't be read, job must fail. - Script must check if Git tag above version exists. If yes, job must fail.
- Gradle must build, run tests, publish to Nexus.
- Gradle script must set
versionproperty to a content of/.versionfile.
- Gradle script must set
- Script must check if