Skip to content
Snippets Groups Projects
Commit 02225a2a authored by Lene Wasskog's avatar Lene Wasskog
Browse files

doc: Add (temporary) description of build + deploy [MAD-91]

parent 36af78d0
Branches
Tags
1 merge request!1Feature/mad 91 gitlab pipeline
Pipeline #693 passed
......@@ -44,4 +44,62 @@ bumpver update --major
[(Source)](https://semver.org/#summary)
### References
We used this excellent guide for packaging: https://realpython.com/pypi-publish-python-package/
\ No newline at end of file
We used this excellent guide for packaging: https://realpython.com/pypi-publish-python-package/
### Manual deployment
Temporary notes of steps required for building and uploading package
Create [Personal access token](https://gitlab.nibio.no/-/profile/personal_access_tokens) with name=`gitlab-pypi` and scope=`Api`.
Create file `~/.pypirc` with the following content:
```
[distutils]
index-servers =
gitlab
[gitlab]
repository = https://gitlab.nibio.no/api/v4/projects/401/packages/pypi
username = gitlab-pypi
password = <personal access token>
```
Clone project, build and deploy package
```
$ git clone git@gitlab.nibio.no:VIPS/vipscore-python-common.git
$ cd vipscore-python-common
$ pip install build twine
$ python3 -m build
-> Successfully built vipscore_common-0.1.6.tar.gz and vipscore_common-0.1.6-py3-none-any.whl
$ python3 -m twine upload --repository gitlab dist/* --verbose
-> Uploading vipscore_common-0.1.6-py3-none-any.whl
-> 201 Created
-> Uploading vipscore_common-0.1.6.tar.gz
-> 201 Created
```
### Pipeline deployment
See pipeline configuration in `.gitlab-ci.yml`.
Temporarily setting up a gitlab runner for this specific project on `vipscore01test.nibio.no`. We should probably set up a common group runner instead.
```
ssh nibio@vipscore01test.nibio.no
```
Find the project specific `REGISTRATION_TOKEN`: https://gitlab.nibio.no/VIPS/vipscore-python-common/-/settings/ci_cd
```
sudo gitlab-runner register -n --url https://gitlab.nibio.no \
--registration-token <REGISTRATION_TOKEN> \
--executor docker \
--description "vipscore-python-common-runner" \
--docker-image "docker:20.10.16" \
--tag-list vips-runner \
--docker-wait-for-services-timeout -1
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment