Compare commits
No commits in common. "698fd52a034ba09c3b85484d0012640489544ae8" and "44bd9a6446f76a121c1ec4f4433d0c151094c8e9" have entirely different histories.
698fd52a03
...
44bd9a6446
1 changed files with 3 additions and 30 deletions
33
build.sh
33
build.sh
|
@ -9,27 +9,11 @@ cd $( dirname $0 )
|
||||||
echo "Clean previous build..."
|
echo "Clean previous build..."
|
||||||
rm -fr dist deb_dist
|
rm -fr dist deb_dist
|
||||||
|
|
||||||
if [ -n "$CI" -a $UID -eq 0 ]
|
|
||||||
then
|
|
||||||
echo "CI environment detected, set current directory as git safe for root"
|
|
||||||
git config --global --add safe.directory $(pwd)
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Detect version using git describe..."
|
echo "Detect version using git describe..."
|
||||||
VERSION="$( git describe --tags|sed 's/^[^0-9]*//' )"
|
VERSION="$( git describe --tags|sed 's/^[^0-9]*//' )"
|
||||||
|
|
||||||
echo "Computing python version..."
|
echo "Set version=$VERSION in setup.py using sed..."
|
||||||
if [ $( echo "$VERSION"|grep -c "-" ) -gt 0 ]
|
sed -i "s/^version *=.*$/version = '$VERSION'/" setup.py
|
||||||
then
|
|
||||||
echo "Development version detected ($VERSION), compute custom python dev version"
|
|
||||||
PY_VERSION="$( echo "$VERSION"|sed 's/-\([0-9]\)\+-.*$/.dev\1/' )"
|
|
||||||
else
|
|
||||||
echo "Clean tagged version detected, use it"
|
|
||||||
PY_VERSION="$VERSION"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Set version=$PY_VERSION in setup.py using sed..."
|
|
||||||
sed -i "s/^version *=.*$/version = '$PY_VERSION'/" setup.py
|
|
||||||
|
|
||||||
if [ -d venv ]
|
if [ -d venv ]
|
||||||
then
|
then
|
||||||
|
@ -88,10 +72,6 @@ else
|
||||||
echo "Use debian codename from environment ($DEBIAN_CODENAME)"
|
echo "Use debian codename from environment ($DEBIAN_CODENAME)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Compute debian package version
|
|
||||||
DEB_VERSION_SUFFIX="-1"
|
|
||||||
DEB_VERSION="$VERSION$DEB_VERSION_SUFFIX"
|
|
||||||
|
|
||||||
echo "Generate debian changelog using gitdch..."
|
echo "Generate debian changelog using gitdch..."
|
||||||
GITDCH_ARGS=('--verbose')
|
GITDCH_ARGS=('--verbose')
|
||||||
[ -n "$QUIET_ARG" ] && GITDCH_ARGS=('--warning')
|
[ -n "$QUIET_ARG" ] && GITDCH_ARGS=('--warning')
|
||||||
|
@ -107,18 +87,11 @@ then
|
||||||
fi
|
fi
|
||||||
$GITDCH \
|
$GITDCH \
|
||||||
--package-name mylib \
|
--package-name mylib \
|
||||||
--version "${DEB_VERSION}" \
|
--version "${VERSION}" \
|
||||||
--version-suffix "${DEB_VERSION_SUFFIX}" \
|
|
||||||
--code-name $DEBIAN_CODENAME \
|
--code-name $DEBIAN_CODENAME \
|
||||||
--output debian/changelog \
|
--output debian/changelog \
|
||||||
--release-notes ../../dist/release_notes.md \
|
--release-notes ../../dist/release_notes.md \
|
||||||
--path ../../ \
|
--path ../../ \
|
||||||
--exclude "^CI: " \
|
|
||||||
--exclude "\.?woodpecker(\.yml)?" \
|
|
||||||
--exclude "build(\.sh)?" \
|
|
||||||
--exclude "tests(\.sh)?" \
|
|
||||||
--exclude "README(\.md)?" \
|
|
||||||
--exclude "^Merge branch " \
|
|
||||||
"${GITDCH_ARGS[@]}"
|
"${GITDCH_ARGS[@]}"
|
||||||
|
|
||||||
echo "Add custom package name for dependencies..."
|
echo "Add custom package name for dependencies..."
|
||||||
|
|
Loading…
Reference in a new issue