Skip to content

Commit 3e5259d

Browse files
authored
Merge pull request #71 from ioet/feature/add-semantic-versioning#49
Add semantic versioning Close #49
2 parents 84b1e70 + 65fe776 commit 3e5259d

File tree

6 files changed

+27
-4
lines changed

6 files changed

+27
-4
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM python:3.8-alpine
22

3-
ARG buildDeps='g++ gnupg curl'
3+
ARG buildDeps='g++ gnupg curl libffi-dev openssl-dev'
44

55
WORKDIR /usr/src/app
66

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,17 @@ as well as its correspondent options.
166166
python cli.py gen_swagger_json -f ~/Downloads/swagger.json
167167
```
168168

169+
## Semantic versioning
170+
171+
### Style
172+
We use [angular commit message style](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits) as the standard commit message style.
173+
174+
### Release
175+
1. The release is automatically done by the [TimeTracker CI](https://dev.azure.com/IOET-DevOps/TimeTracker-API/_build?definitionId=1&_a=summary) although can also be done manually. The variable `GH_TOKEN` is required to post releases to Github. The `GH_TOKEN` can be generated following [these steps](https://help.github.com/es/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line).
176+
177+
2. We use the command `semantic-release publish` after a successful PR to make a release. Check the library
178+
[python-semantic-release](https://python-semantic-release.readthedocs.io/en/latest/commands.html#publish) for details of underlying operations.
179+
169180
## Run as docker container
170181
1. Build image
171182
```bash

requirements/time_tracker_api/prod.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ flask-restplus==0.12.1
2323
#CLI support
2424
Flask-Script==2.0.6
2525

26+
#Semantic versioning
27+
python-semantic-release==5.1.0
28+
2629
# The Debug Toolbar
2730
Flask-DebugToolbar==0.11.0
2831

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
testpaths = tests
33
addopts = -p no:warnings
44

5+
[semantic_release]
6+
version_variable = time_tracker_api/__init__.py:__version__
7+
upload_to_pypi = false
8+
59
[coverage:run]
610
branch = True
711
source =

time_tracker_api/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
from flask import Flask
55

6+
__version__ = '0.0.2'
7+
68
flask_app: Flask = None
79

810

time_tracker_api/api.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
from flask import current_app as app
66
from flask_restplus import Api, fields
77
from flask_restplus._http import HTTPStatus
8+
from time_tracker_api import __version__
89

910
faker = Faker()
1011

11-
api = Api(version='1.0.1',
12-
title="TimeTracker API",
13-
description="API for the TimeTracker project")
12+
api = Api(
13+
version=__version__,
14+
title="TimeTracker API",
15+
description="API for the TimeTracker project"
16+
)
1417

1518
# Common models structure
1619
audit_fields = {

0 commit comments

Comments
 (0)