<commit_before>#!/bin/bash
set -e

# set build number to 0 if not run on circle ci
export CIRCLE_BUILD_NUM=${CIRCLE_BUILD_NUM:-0}

pyb

cd target/dist/* &&

# deb
fpm \
  --iteration $CIRCLE_BUILD_NUM \
  --no-python-fix-name \
  --python-install-lib '/usr/lib/python2.7/dist-packages' \
  --python-install-bin '/usr/bin' --no-python-dependencies \
  --depends python --depends python-boto --depends python-click --depends python-networkx --depends python-decorator --depends python-ordereddict --depends python-yaml -s python -t deb setup.py

# rpm
fpm \
  --iteration $CIRCLE_BUILD_NUM \
  --no-python-fix-name \
  --python-install-lib '/usr/lib/python2.6/site-packages' \
  --python-install-bin '/usr/bin' --no-python-dependencies \
  --depends python --depends python-boto --depends python-click --depends python-networkx --depends python-ordereddict --depends python-yaml -s python -t rpm setup.py

#pypi
if [ -n "$PYPI_USER" ] && [ -n "$PYPI_PASSWORD" ]; then
    echo "Generating pypi auth config"
    cat > ~/.pypirc << EOF
[distutils]
index-servers =
    pypi

[pypi]
username:$PYPI_USER
password:$<PASSWORD>
EOF
fi

python setup.py sdist upload || exit 0

# upload
package_cloud push marco-hoyer/cfn-sphere/scientific/6 *.rpm
package_cloud push marco-hoyer/cfn-sphere/debian/wheezy *.deb
package_cloud push marco-hoyer/cfn-sphere/debian/jessie *.deb
package_cloud push marco-hoyer/cfn-sphere/ubuntu/trusty *.deb<commit_msg>only build packages directly for specific versions, no iterations<commit_after>#!/bin/bash
set -e

pyb

cd target/dist/* &&

# deb
fpm \
  --no-python-fix-name \
  --python-install-lib '/usr/lib/python2.7/dist-packages' \
  --python-install-bin '/usr/bin' --no-python-dependencies \
  --depends python --depends python-boto --depends python-click --depends python-networkx --depends python-decorator --depends python-ordereddict --depends python-yaml -s python -t deb setup.py

# rpm
fpm \
  --no-python-fix-name \
  --python-install-lib '/usr/lib/python2.6/site-packages' \
  --python-install-bin '/usr/bin' --no-python-dependencies \
  --depends python --depends python-boto --depends python-click --depends python-networkx --depends python-ordereddict --depends python-yaml -s python -t rpm setup.py

# upload deb and rpm
package_cloud push marco-hoyer/cfn-sphere/scientific/6 *.rpm
package_cloud push marco-hoyer/cfn-sphere/debian/wheezy *.deb
package_cloud push marco-hoyer/cfn-sphere/debian/jessie *.deb
package_cloud push marco-hoyer/cfn-sphere/ubuntu/trusty *.deb

# upload package to pypi
if [ -n "$PYPI_USER" ] && [ -n "$PYPI_PASSWORD" ]; then
    echo "Generating pypi auth config"
    cat > ~/.pypirc << EOF
[distutils]
index-servers =
    pypi

[pypi]
username:$PYPI_USER
password:$<PASSWORD>
EOF
fi

python setup.py sdist upload
{'fraction_non_alphanumeric': 0.14342342342342343, 'fraction_numerical': 0.0046846846846846845, 'mean_word_length': 3.357927786499215, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1977747', 'n_tokens_mistral': 1055, 'n_tokens_neox': 979, 'n_words': 236}