diff options
author | Vanessa Rene Valderrama <vvalderrama@linuxfoundation.org> | 2018-02-27 15:10:17 -0800 |
---|---|---|
committer | Jeremy Phelps <jphelps@linuxfoundation.org> | 2018-03-09 11:27:56 -0600 |
commit | 295975d522aaa584bc3dd79c043b1a6003977f22 (patch) | |
tree | 97c4d8f68ff8d4bdd476f37245c2592d18017d82 /shell | |
parent | 7c8380e89cfc00cb0002e9c08aec0f9aeaf2ea98 (diff) |
Configure PyPI releases
This changes adds the following functionality for PyPI releases
- macros
- A PyPI server macro
- scripts
- A script to build artifacts
- A script to publish artifacts
- templates
- Templates for release
- jobs
- Jobs for release
- Nexus3 staging
- Nexus3 release
- PyPI index will be added at a later date
Issue-ID: CIMAN-137
Change-Id: I53522ed2fa2f462afebaac94c44fa2a9979e9c2a
Signed-off-by: Vanessa Rene Valderrama <vvalderrama@linuxfoundation.org>
Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
Signed-off-by: Jeremy Phelps <jphelps@linuxfoundation.org>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/pypi-dist-build.sh | 11 | ||||
-rw-r--r-- | shell/pypi-get.sh | 15 | ||||
-rw-r--r-- | shell/pypi-publish.sh | 11 |
3 files changed, 37 insertions, 0 deletions
diff --git a/shell/pypi-dist-build.sh b/shell/pypi-dist-build.sh new file mode 100644 index 000000000..7733f6242 --- /dev/null +++ b/shell/pypi-dist-build.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Script to build PyPI artifacts +set -e -x -o pipefail + +virtualenv /tmp/v/twine +source "/tmp/v/twine/bin/activate" + +pip install twine wheel + +cd "$WORKSPACE/$TOX_DIR" +python setup.py sdist bdist_wheel diff --git a/shell/pypi-get.sh b/shell/pypi-get.sh new file mode 100644 index 000000000..40900a5d7 --- /dev/null +++ b/shell/pypi-get.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Script to download PyPI artifacts + +PROJECT_NAME=$(grep name= setup.py | cut -d"'" -f2) +ARTIFACT_VERSION=$(grep __version__ ${PROJECT_NAME}/_version.py | cut -d'"' -f2) +REPO_URL="https://nexus3.onap.org/repository/PyPi.staging/packages" +TAR_NAME="$REPO_URL/$PROJECT_NAME/$ARTIFACT_VERSION/$PROJECT_NAME-$ARTIFACT_VERSION.tar.gz" +WHEEL_NAME="${REPO_URL}/${PROJECT_NAME}/${ARTIFACT_VERSION}/${PROJECT_NAME}-${ARTIFACT_VERSION}-py2-none-any.whl" + +mkdir dist +cd dist + +wget ${TAR_NAME} +wget ${WHEEL_NAME} diff --git a/shell/pypi-publish.sh b/shell/pypi-publish.sh new file mode 100644 index 000000000..7ea3fa2d9 --- /dev/null +++ b/shell/pypi-publish.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Script to publush PyPI artifacts +set -e -x -o pipefail + +virtualenv /tmp/v/twine +source "/tmp/v/twine/bin/activate" + +pip install twine + +cd "$WORKSPACE/$TOX_DIR" +twine upload -r $PYPI_SERVER dist/* |