Skip to content

Latest commit

 

History

History
175 lines (136 loc) · 5.51 KB

releasing.rst

File metadata and controls

175 lines (136 loc) · 5.51 KB

Releasing

  1. Preparations

    1. Update version number in meta.py. 1. Update the CHANGELOG.rst. 1. Updated README.rst and documentation.

  2. Run tests

    make test
    make lint
    make docs
    tox
    python setup.py check --restructuredtext
    
  3. Test installation

    make clean
    make clean-db
    pip uninstall snippy
    pip install . --user
    snippy --help
    snippy import --defaults
    snippy import --defaults --solutions
    snippy import --defaults --references
    snippy search --sall docker
    rm -f ${HOME}/devel/temp/snippy.db
    snippy import --defaults --storage-path ${HOME}/devel/temp
    snippy import --defaults --solutions --storage-path ${HOME}/devel/temp
    snippy import --defaults --references --storage-path ${HOME}/devel/temp
    snippy --server --storage-path ${HOME}/devel/temp --port 8080 --ip 127.0.0.1 &
    curl -s -X GET "http://127.0.0.1:8080/snippy/api/app/v1/snippets?sall=docker&limit=2" -H "accept: application/vnd.api+json" | python -m json.tool
    pkill snippy
    
  4. Test with PyPI

    # Install the tool into test PyPI.
    make clean
    make clean-db
    python setup.py sdist bdist_wheel upload -r testpypi # repository: https://test.pypi.org/legacy/ in ~/.pypirc
    sudo pip uninstall snippy -y
    pip uninstall snippy -y
    
    # Set path to local user bin and install the tool from test PyPI.
    PATH=$HOME/.local/bin:$PATH
    pip install --user --index-url https://test.pypi.org/simple/ snippy
    snippy --help
    snippy import --defaults
    snippy import --defaults --solutions
    snippy search --sall docker
    
    # Run all example commands from top down from:
    snippy --help
    snippy --help examples
    
    # Uninstall
    pip uninstall snippy -y
    
  5. Test with Docker

    su
    make docker
    docker rm $(docker ps --all -q -f status=exited)
    docker images -q --filter dangling=true | xargs docker rmi
    docker images
    docker rmi heilaaks/snippy:v0.7.0
    docker rmi docker.io/heilaaks/snippy:latest
    docker rmi docker.io/heilaaks/snippy:v0.7.0
    docker run heilaaks/snippy --help
    docker run heilaaks/snippy search --sall docker
    docker run -d --net="host" --name snippy heilaaks/snippy --server --port 8080 --ip 127.0.0.1 -vv
    curl -s -X GET "http://127.0.0.1:8080/snippy/api/app/v1/snippets?sall=docker&limit=2" -H "accept: application/vnd.api+json"
    docker logs 632e97aa83fe
    docker stop 632e97aa83fe
    docker rm $(docker ps --all -q -f status=exited)
    docker run -d --net="host" --name snippy heilaaks/snippy --server --log-json -vv &
    curl -s -X GET "http://127.0.0.1:8080/snippy/api/app/v1/snippets?sall=docker&limit=2" -H "accept: application/vnd.api+json"
    docker logs f72b3902dd4b
    
  6. Test with PyPy

    # Default test box install PyPy 2.7 from dnf.
    sudo dnf install pypy
    export PYTHONPATH=/usr/lib64/python2.7/site-packages/
    wget https://bootstrap.pypa.io/get-pip.py
    sudo pypy get-pip.py
    sudo pypy -m pip install codecov
    sudo pypy -m pip install logging_tree
    sudo pypy -m pip install mock
    sudo pypy -m pip install pytest
    sudo pypy -m pip install pytest-cov
    sudo pypy -m pip install pytest-mock
    sudo pypy -m pip install falcon
    sudo pypy -m pip install gunicorn
    sudo pypy -m pip install jsonschema
    pypy runner --help
    pypy runner --server -vv
    pypy -m pytest -x ./tests/test_*.py --cov snipp
    unset PYTHONPATH
    
  7. Verify data in CHANGELOG.rst

    1. Update the CHANGELOG.rst release date if needed.
  8. Make tag

    git tag -a v0.8.0 -m "Add new content category resources"
    git push -u origin v0.8.0
    
  9. Releas in PyPI

    python setup.py sdist bdist_wheel
    twine upload dist/*
    
  10. Test PyPI release

    sudo pip uninstall snippy -y
    pip install snippy --user
    snippy --help
    snippy import --defaults
    snippy import --defaults --solutions
    snippy search --sall docker
    
  11. Release in Docker Hub

    su
    docker login docker.io
    docker images
    sudo docker tag 5dc22d1d3380 docker.io/heilaaks/snippy:v0.7.0
    sudo docker tag 5dc22d1d3380 docker.io/heilaaks/snippy:latest
    sudo docker push docker.io/heilaaks/snippy:v0.7.0
    sudo docker push docker.io/heilaaks/snippy:latest
    
  12. Test Docker release

    su
    docker rm $(docker ps --all -q -f status=exited)
    docker images -q --filter dangling=true | xargs docker rmi
    docker images
    docker rmi heilaaks/snippy:v0.7.0
    docker rmi heilaaks/snippy:latest
    docker rmi docker.io/heilaaks/snippy:latest
    docker rmi docker.io/heilaaks/snippy:v0.7.0
    docker run snippy --help
    docker run snippy search --sall docker
    docker run -d --net="host" --name snippy heilaaks/snippy --server --port 8080 --ip 127.0.0.1 -vv
    curl -s -X GET "http://127.0.0.1:8080/snippy/api/app/v1/snippets?sall=docker&limit=2" -H "accept: application/vnd.api+json" | python -m json.tool
    docker run -d --net="host" --name snippy heilaaks/snippy --server --log-json -vv
    curl -s -X GET "http://127.0.0.1:8080/snippy/api/app/v1/snippets?sall=docker&limit=2" -H "accept: application/vnd.api+json" | python -m json.tool
    
  13. Release news

    1. Make new release in Github.