release
187 lines
5.5 kB
#!/usr/bin/env sos-runner #fileformat=SOS1.0 # This script releases SoS to different destinations, including # # 1. source distribution to pip # 2. docker images to docker hub # 3. website to github.io [patch: shared='version'] parameter: version = str sh: perl -pi.bak -e "s/^__version__ = .*/__version__ = '${version}'/" ../src/sos/_version.py [pip] parameter: version = str # check the version of the latest version cur_ver = get_output("pip show sos | grep Version | cut -d' ' -f2").strip() # do not upload if the version on pip is the current one stop_if(cur_ver == version) sh: workdir='..' python setup.py sdist && \ rm -rf /tmp/test_sos && \ mkdir /tmp/test_sos && \ cp dist/sos-${version}.tar.gz /tmp/test_sos && \ cd /tmp/test_sos && \ tar zxf sos-${version}.tar.gz && \ cd sos-${version} && \ python setup.py install sh: workdir='..' python setup.py sdist upload && \ pip install sos --upgrade [update-docker] # add documentation to Docker container depends: executable('docker') # copy doc over run: workdir='..' rm -rf development/docker-notebook/doc # copy only ipynb and .sos files to docker rsync -av --prune-empty-dirs --include "*/" --exclude ".ipynb_checkpoints" \ --include "*.ipynb" --include "*.jpg" --include "*.png" --exclude "*" \ docs/src/documentation docs/src/tutorials docs/src/examples docs/doc/media \ development/docker-notebook/doc # update docker and push run: docker build --no-cache -t mdabioinfo/sos docker-base docker push mdabioinfo/sos docker build --no-cache -t mdabioinfo/sos-notebook docker-notebook docker push mdabioinfo/sos-notebook # update docker on ec2 [update-ec2] parameter: pem=glob.glob('mda*.pem') run: ssh -i ${pem} ubuntu@ec2-34-192-184-206.compute-1.amazonaws.com 'bash -s '< update_ec2_docker.sh [getFileNames] run: python ../docs/js/findnames.py [convert-documentation] input: '../docs/src/documentation/*.ipynb', group_by=1 depends: '../docs/src/documentation/toc_doc.tpl' output: _input[0].replace('/src/', '/doc/').replace('.ipynb', '.html') run: cd ../docs/src/documentation sos convert ${_input!a} ${_output!a} --template toc_doc perl -0777 -pi -e 'BEGIN{undef $/;} s/