Skip to content

Instantly share code, notes, and snippets.

@jsilberm
Last active August 4, 2023 00:51
Show Gist options
  • Save jsilberm/6f2aa9bfaf29c155d29d15330e6b210d to your computer and use it in GitHub Desktop.
Save jsilberm/6f2aa9bfaf29c155d29d15330e6b210d to your computer and use it in GitHub Desktop.
PyPi Build Release Cycle

Someday this will be automated. In the meantime, here is the sequence. This almost runs non=interactively. You will need the password for the amdpnso_release account

#!/bin/bash

if [ $# -ne 1 ]; then
   echo Usage: $0 release-ver
   exit 1
else
   echo Building PyPi for $1
fi

if [ -z "$PSM_IP" ] || [ -z "$PSM_USER" ] || [ -z "$PSM_PASSWORD" ]; then
     echo MUST set PSM_IP, PSM_USER, PSM_PASSWORD in your environment
     exit
fi

if ! command -v mvn > /dev/null ; then
   echo Must install "mvn"
   exit 1
fi


REL=$1
DIST=dss
PSMCLIENT_DIR=`pwd`/psmclient-${REL}
PYPI_DIR=`pwd`/pypi-${REL}

# pip install --upgrade pip
# pip3 install requests build twine
git clone --depth 1 [email protected]:pensando/psmclient.git ${PSMCLIENT_DIR}
git clone --depth 1 [email protected]:pensando/pypi.git $PYPI_DIR
cd ${PYPI_DIR}/src_$DIST
git rm -rf .
cd ${PSMCLIENT_DIR}
make build-generator
make gen python ${DIST}
mkdir -p ${PYPI_DIR}/src_${DIST}
mv ${PSMCLIENT_DIR}/python/generated/src_${DIST}/* ${PYPI_DIR}/src_${DIST}
cd ${PYPI_DIR}/src_${DIST}
# git add .
# git commit -a -m "Update for $REL"
# git push origin
# python3 -m build .
# python3 -m twine upload dist/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment