#!/bin/bash set -euxo pipefail nexus_domain=$(hostname --fqdn) rm -rf tmp/hello-world-pypi-package install -d tmp cp -r /vagrant/hello-world-pypi-package tmp cd tmp/hello-world-pypi-package # create the venv. apt-get install -y python3-venv rm -rf .venv python3 -m venv .venv set +x && source .venv/bin/activate && set -x # create the hello_world package. # see https://packaging.python.org/en/latest/tutorials/packaging-projects/ # see https://help.sonatype.com/en/pypi-repositories.html # NB requirements.txt was created as: # python3 -m pip install build twine # python3 -m pip freeze >requirements.txt python3 -m pip install -r requirements.txt python3 -m build --wheel python3 -m pip freeze >.venv/requirements.txt diff -u requirements.txt .venv/requirements.txt || (echo ERROR: requirement.txt is not up-to-date && false) # upload. export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt cat >.venv/twine.conf <.venv/pip.conf <