Commit cd58e443 authored by Shinya Maeda's avatar Shinya Maeda
Browse files

New versioning guideline

parent 1c17b7b4
Loading
Loading
Loading
Loading
+8 −45
Original line number Diff line number Diff line
@@ -2,57 +2,20 @@

The [Auto-DevOps](https://docs.gitlab.com/ee/topics/autodevops/) [deploy stage](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml) image.

## Notice

We're moving [auto-deploy-app chart](https://gitlab.com/gitlab-org/charts/auto-deploy-app) into this project
in order for [Versioning charts in order to ship breaking change safely](https://gitlab.com/gitlab-org/charts/auto-deploy-app/-/issues/70),
you see bundled charts in `vendor/auto-deploy-app-chart`.

## Development

Scripts in this repository follow GitLab's
[shell scripting guide](https://docs.gitlab.com/ee/development/shell_scripting_guide/)
and enforces `shellcheck` and `shfmt`.
Read about the [Development guide](doc/development.md)

## Contributing and Code of Conduct

Please see [CONTRIBUTING.md](CONTRIBUTING.md)

## Upgrading

### v0.1.0

Starting from GitLab 12.2, the [`Jobs/Deploy.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml)
template will use the Docker image generated from this project. Changes from previous version of `Jobs/Deploy.gitlab-ci.yml` include:

* Switch from using `sh` to `bash`.
* `install_dependencies` is removed as it is now part of the Docker image.
*  All the other commands should be prepended with `auto-deploy`.
   For example, `check_kube_domain` now becomes `auto-deploy check_kube_domain`.

# Generating a new auto-deploy image

To generate a new image you must follow the git commit guidelines below, this
will trigger a semantic version bump which will then cause a new pipeline
that will build and tag the new image

## Git Commit Guidelines

This project uses [Semantic Versioning](https://semver.org). We use commit
messages to automatically determine the version bumps, so they should adhere to
the conventions of [Conventional Commits (v1.0.0-beta.2)](https://www.conventionalcommits.org/en/v1.0.0-beta.2/).

### TL;DR

- Commit messages starting with `fix: ` trigger a patch version bump
- Commit messages starting with `feat: ` trigger a minor version bump
- Commit messages starting with `BREAKING CHANGE: ` trigger a major version bump.

## Automatic versioning

Each push to `master` triggers a [`semantic-release`](https://semantic-release.gitbook.io/semantic-release/)
CI job that determines and pushes a new version tag (if any) based on the
last version tagged and the new commits pushed. Notice that this means that if a
Merge Request contains, for example, several `feat: ` commits, only one minor
version bump will occur on merge. If your Merge Request includes several commits
you may prefer to ignore the prefix on each individual commit and instead add
an empty commit summarizing your changes like so:
## Release

```
git commit --allow-empty -m '[BREAKING CHANGE|feat|fix]: <changelog summary message>'
```
Read about the [Package release process](doc/release.md)

doc/development.md

0 → 100644
+39 −0
Original line number Diff line number Diff line
# Development

## Commit guideline

To generate a new image you must follow the git commit guidelines below, this
will trigger a semantic version bump which will then cause a new pipeline
that will build and tag the new image

## Git Commit Guidelines

This project uses [Semantic Versioning](https://semver.org). We use commit
messages to automatically determine the version bumps, so they should adhere to
the conventions of [Conventional Commits (v1.0.0-beta.2)](https://www.conventionalcommits.org/en/v1.0.0-beta.2/).

### TL;DR

- Commit messages starting with `fix: ` trigger a patch version bump
- Commit messages starting with `feat: ` trigger a minor version bump
- Commit messages starting with `BREAKING CHANGE: ` trigger a major version bump.

## Automatic versioning

Each push to `master` triggers a [`semantic-release`](https://semantic-release.gitbook.io/semantic-release/)
CI job that determines and pushes a new version tag (if any) based on the
last version tagged and the new commits pushed. Notice that this means that if a
Merge Request contains, for example, several `feat: ` commits, only one minor
version bump will occur on merge. If your Merge Request includes several commits
you may prefer to ignore the prefix on each individual commit and instead add
an empty commit summarizing your changes like so:

```
git commit --allow-empty -m '[BREAKING CHANGE|feat|fix]: <changelog summary message>'
```

## Tests

Scripts in this repository follow GitLab's
[shell scripting guide](https://docs.gitlab.com/ee/development/shell_scripting_guide/)
and enforces `shellcheck` and `shfmt`.

doc/release.md

0 → 100644
+26 −0
Original line number Diff line number Diff line
# Release

## Semantic Versioning

Auto Deploy Image is versioned according to [Semantic Versioning](https://semver.org/).
Please follow [Specification](https://semver.org/#semantic-versioning-specification-semver)
when you tag a new release.

### Branches

- `master` ... The latest change. Considered as Edge.
- `vX.0.0-pre` ... A pre-release version

## Generating a new auto-deploy image

Please see [the commit rules](development.md#commit-guideline)

### v0.1.0

Starting from GitLab 12.2, the [`Jobs/Deploy.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml)
template will use the Docker image generated from this project. Changes from previous version of `Jobs/Deploy.gitlab-ci.yml` include:

* Switch from using `sh` to `bash`.
* `install_dependencies` is removed as it is now part of the Docker image.
*  All the other commands should be prepended with `auto-deploy`.
   For example, `check_kube_domain` now becomes `auto-deploy check_kube_domain`.