Commit e70c1b89 authored by BODERE's avatar BODERE
Browse files

add deployment scritpt

parent 1faafd57
#!/usr/bin/env bash
set -Eeuo pipefail
trap "echo ERR trap fired!" ERR
function clean() {
echo "---------------------------------------------------------------"
echo "Clean workspace"
echo "---------------------------------------------------------------"
python setup.py clean --all
find dist -type f -delete
find lib -type d -name "*.egg-info" -exec rm -rf {} +
}
#
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
PROJECT_ROOT_DIR="$(dirname "$DIR")"
echo "Goto $PROJECT_ROOT_DIR"
cd "$PROJECT_ROOT_DIR"
# clean ws
clean
# generate wheel
echo "---------------------------------------------------------------"
echo "Generate wheel"
echo "---------------------------------------------------------------"
python setup.py bdist_wheel
#
echo "---------------------------------------------------------------"
echo "Deploy to binary repository"
echo "---------------------------------------------------------------"
if [[ -z $(find dist -name "*.dev*") ]]; then
echo "Upload to RELEASE"
twine upload --repository nexus-public-release dist/*
else
echo "Upload to SNAPSHOT"
twine upload --repository nexus-public-snapshot dist/*
fi
# clean ws
clean
#!/bin/bash
set -eu
echo "Running pylint..."
{{PYLINT}} -j8 -E lib/
#!/bin/bash
set -Eeuo pipefail
trap "echo ERR trap fired!" ERR
HOOKS_SRC="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
GIT_DIR="$HOOKS_SRC/../../.git"
PYLINT=$(command -v pylint)
echo "Pylint path: $PYLINT"
cp "$HOOKS_SRC/pre-commit" "$GIT_DIR/hooks/"
sed -i "s:{{PYLINT}}:$PYLINT:g" "$GIT_DIR/hooks/pre-commit"
echo "Git hooks setup"
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment