Skip to content
Camila Maia edited this page Mar 2, 2023 · 9 revisions

Here you will find how to deploy a new production version of ScanAPI.

Requirements:

Steps:

  1. Release PR
  2. Deploy on GitHub
  3. Push Docker Images

1. Release PR

Bump the lib Version

Check the last release number at https://pypi.org/project/scanapi/#history

Increment the version number in the pyproject.toml according to the version you have just got: https://github.com/scanapi/scanapi/blob/master/pyproject.toml#L3

Also, increment the version number in the Dockerfile according to the version you have just got: https://github.com/scanapi/scanapi/blob/master/Dockerfile#L9

Update the CHANGELOG.md

Add a new version title with the new version number and the current date, like this

And add the version links, like this

Create the PR

Create a PR named Release <version> containing these two changes above.

Example of Release PR

Merge the PR

Once the PR has been accepted and passed on all checks, merge it.

2. Deploy on GitHub

Deploy on GitHub is done when a new release is created.

  • The tag version should be v<version>, like for example v0.0.18.
  • The release title should be the same as tag version,(e.g v0.0.18).
  • The release description should be the content copied from the CHANGELOG.md file from the corresponding version section.

Real examples are available at: https://github.com/scanapi/scanapi/releases.

When the Deploy on GitHub is done, the new version will be also automatically deployed on PyPI. Download the new ScanAPI version from PyPI and test if everything is working as expected.

3. Push Docker Images

On the ScanAPI repository, in the main branch, run the following commands from your terminal:

docker build -f Dockerfile -t camilamaia/scanapi:<version_number> -t camilamaia/scanapi:latest . --no-cache
docker tag camilamaia/scanapi:<version_number> camilamaia/scanapi:<version_number>
docker tag camilamaia/scanapi:latest camilamaia/scanapi:latest
docker push camilamaia/scanapi:<version_number>
docker push camilamaia/scanapi:latest

Example:

docker build -f Dockerfile -t camilamaia/scanapi:2.5.0 -t camilamaia/scanapi:latest . --no-cache
docker tag camilamaia/scanapi:2.5.0 camilamaia/scanapi:2.5.0
docker tag camilamaia/scanapi:latest camilamaia/scanapi:latest
docker push camilamaia/scanapi:2.5.0
docker push camilamaia/scanapi:latest

This will push the new images to Docker Hub.