-
Notifications
You must be signed in to change notification settings - Fork 26
Release steps
Nitish Gupta edited this page Jul 26, 2018
·
10 revisions
# These commands are invoked twice due to the Configuration Matrix.
# Hence, we run them only during Python 3
# Clean any local changes
git clean -f && git reset --hard origin/master
git config user.email "[email protected]"
git config user.name "Jenkins CI"
PYENV_HOME=$WORKSPACE/.pyenv/
PYTHON=python3
MY_PACKAGE_NAME=ccg_nlpy
# Delete previously built virtualenv
if [ -d $PYENV_HOME ]; then
rm -rf $PYENV_HOME
fi
# Create virtualenv and install necessary packages
virtualenv --no-site-packages -p /usr/bin/$PYTHON $PYENV_HOME
. $PYENV_HOME/bin/activate
pip install --quiet bumpversion
# Increment version number here.
# ${RELEASE_TYPE} environment variable can be one of - patch, minor, major
# The version will be updated according to this parameter.
# If you want to update the version manually, make sure to update setup.py and
# setup.cfg files instead of this line.
bumpversion ${RELEASE_TYPE} version.py
# Setup the authentication required for deploy
# Start the ssh-agent in the background
eval "$(ssh-agent -s)"
ssh-add /home/ngupta19/.ssh/id_rsa
# Python deployment
rm -rf dist/
PYENV_HOME=$WORKSPACE/.pyenv/
PYTHON=python3
MY_PACKAGE_NAME=ccg_nlpy
# Delete previously built virtualenv
if [ -d $PYENV_HOME ]; then
rm -rf $PYENV_HOME
fi
# Create virtualenv and install necessary packages
virtualenv --no-site-packages -p /usr/bin/$PYTHON $PYENV_HOME
. $PYENV_HOME/bin/activate
pip install --quiet twine
pip install wheel
# Python command to create build artifacts
# sdist - Source Distribution (.tar.gz)
# bdist_wheel - Binary Distribution in Wheel format (.whl)
# --universai - Single build targetting py2 and py3
python setup.py sdist bdist_wheel --universal
# Upload to PYPI. Requires a credential file that is available at
# /scratch/jenkins_root/pypirc
twine upload dist/* --config-file /scratch/jenkins_root/pypirc
# Push changes to repository
git push origin HEAD:master
# Publish documentations
pip install --quiet pdoc
pip install .
rm -rf html
pdoc --html --html-dir html ccg_nlpy
# Copy documentations to legolas.
scp -r html/ccg_nlpy/* [email protected]:/srv/data/cogcomp/html/software/doc/ccg_nlpy/