-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sh
executable file
·36 lines (30 loc) · 1.34 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -ex
if [ ! -z "$(git status --porcelain --untracked-files=no)" ]; then
echo "git is not clean. Please commit files and retry"
exit 1
fi
#git add HISTORY.rst
#git commit -m "Changelog for upcoming release 0.1.1."
# bumpversion --verbose --dry-run --message '[{now:%Y-%m-%d}]Jenkins Build {$BUILD_NUMBER}: {new_version}' patch # patch could also be minor or major
bumpversion --verbose --message '[{now:%Y-%m-%d}] {new_version}' patch
rm -rf build
rm -rf dist
#python setup.py sdist upload # -url test # behind prod by 1 git commit, but code is same.
#python setup.py bdist_wheel upload # -url test
# test pip install to new virtualenv
# after successful build tests update frozen_requirements.txt
# pip freeze | grep -v azure_cis_scanner > frozen_requirements.txt
# https://gist.github.com/audreyr/5990987
git push origin master
git push origin master --tags
python setup.py sdist upload # -url prod
python setup.py bdist_wheel upload # -url prod
echo "build new containers..."
BASE_CONTAINER=jupyter/minimal-notebook
docker pull $BASE_CONTAINER
PYPI_VERSION=$(grep "__version__ =" setup.py | cut -d ' ' -f3 | sed "s/\'//g")
GIT_COMMIT_SHORT=$(git rev-parse --short HEAD)
DOCKER_TAG=${PYPI_VERSION}-${GIT_COMMIT_SHORT}
AZURE_CIS_SCANNER_IMAGE=kbroughton/azure-cis-scanner-scipy
docker build -t ${AZURE_CIS_SCANNER_IMAGE}:${DOCKER_TAG} .