Updates to deployment docs/files

Change-Id: If4aa072aeca41c18fb5918f6353a4ae61c23257c
This commit is contained in:
Henrik Wahlqvist 2024-06-17 17:00:04 +02:00
parent 7990fbb58c
commit 8f27b6a713
2 changed files with 30 additions and 58 deletions

@ -1,76 +1,46 @@
# powertrain_build Deployment
# powertrain-build Deployment
[TOC]
<!--:powertrain_build:-->
<!--:powertrain-build:-->
After changes has been made to powertrain-build, a new version must be deployed.
## Repositories
### powertrain_build Repository
The powertrain_build git repository can be found
The powertrain-build git repository can be found
[here](https://opendev.org/volvocars/powertrain-build).
The powertrain_build LTS artifactory repository can be found
[here (PLACEHOLDER)](https://artifactory-link).
## Deployment
The powertrain-build PyPi repository can be found
[here](https://pypi.org/project/powertrain-build/).
After changes (important commits, JIRA stories etc.) has been made to powertrain_build,
a new version must be deployed.
## Creating a Release
## Versioning
powertrain-build use [pbr](https://docs.openstack.org/pbr/latest/) to create package meta data.
Please read and use the features of pbr if updating resource files or non-python scripts.
powertrain_build use semantic versioning, _MAJOR.MINOR.PATCH_. The version
is changed by setting an annotated tag with the version (only) at the commit
that should be the released commit.
powertrain-build use semantic versioning, _MAJOR.MINOR.PATCH_.
The version is changed by creating and pushing a signed tag with the version on the commit that should be the released commit.
### Development versioning
Creating a tag will trigger the release pipeline which will run a Zuul jobs that uploads to PyPi.
For more information about creating releases in an opendev project,
see <https://docs.opendev.org/opendev/infra-manual/latest/drivers.html#tagging-a-release>.
If distribution of a development version is needed, set a tag
"dev/\<explanatory-name\>". Scripts will update the patch part and add .devN,
where N is the number of commits since last proper sematic versioning tag.
### Development Releases
## Instructions
Currently, due to the use of pbr, it is hard to utilize the experimental pipeline to upload development releases.
Therefore, we recommend building and uploading locally,
following [this](https://packaging.python.org/en/latest/tutorials/packaging-projects/#generating-distribution-archives) guideline.
Note that the Zuul release job also use the _build_ and _twine_ python modules.
1. Upload the change to Gerrit, have it reviewed, verified and merged.
1. Retrieve the merged commit from Gerrit and ensure it is checked out.
1. Create an annotated tag on the commit.\
`git tag -a -m'<annotation text>' <version>`
1. For a development version:\
`git tag -a -m'<annotation text>' dev/<explanatory>`
1. Push the tag to Gerrit:\
`git push origin <tag-name>`
1. Steps after merge can also be done by setting a tag in Gerrit GUI
1. Zuul will now:
1. Run verification steps.
1. Check that the version complies with PEP440 and semantic version
1. Check that there is no package with this version on artifactory already.
1. Upload the package to artifactory.
1. Modify the _requirements.txt_ file in any repo that requires these
updates.
If you have access to the powertrain-build api token, development releases can be uploaded to the official PyPi repository.
Otherwise, we recommend creating your own TestPyPi package, see [TestPyPi](https://packaging.python.org/en/latest/guides/using-testpypi/).
## Additional notes
If distribution of a development version is needed, `.devN` should be used as postfix,
where "N" equals the release number of the development release.
Note that pbr creates this postfix automatically.
If powertrain_build become dependent on a new package, add the dependency to
_\<package\>/requirements.txt_, or _\<package\>/test-requirements.txt_ if the
dependency is needed only for testing the package, not for using it.
## Additional Notes
powertrain_build use [pbr](https://docs.openstack.org/pbr/latest/) to create
package meta data. Please read and use the features of pbr if updating resource
files or non-python scripts.
## Manual deployment
1. The python package _setuptools_ is required to deploy powertrain_build.
1. Follow the guidelines on the
[LTS artifactory (PLACEHOLDER)](https://artifactory-link)
page about deploying python packages.
1. [LTS artifactory (PLACEHOLDER)](https://artifactory-link) -> Set Me Up
1. `py -3.6 setup.py sdist`, to build the package.
1. `py -3.6 setup.py sdist upload -r local`, to deploy.
1. Deployment in this way may overwrite the package on artifactory
if the user has enough privilege. Be careful not to upload the
same version twice without intending to, as artifactory has no
package upload history and an overwritten package is lost.
1. The bullet about _requirements.txt_ in [Instructions](#instructions) is valid here too.
1. The same [additional notes](#additional-notes) apply to manual deployment.
If powertrain-build become dependent on a new package, add the dependency to _/requirements.txt_,
or _test-requirements.txt_ if the dependency is needed only for testing the package, not for using it.

@ -5,6 +5,8 @@ author-email = henrik.wahlqvist@volvocars.com
summary = A Continuous Integration (CI) build system testing all configurations where a Simulink model is used.
description-file = README.md
description-content-type = text/x-rst; charset=UTF-8
url = https://opendev.org/volvocars/powertrain-build
download_url = https://pypi.org/project/powertrain-build/
license = Apache License, Version 2.0
classifier =
Development Status :: 5 - Production/Stable