Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions toolkit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# PiGx Developer Toolkit

This is script is supposed to be a helper that aggregates commonly used commands.

You may run this script from the base directory of your current pigx-pipeline git/source directory,
as it relies on the configure and make files beeing in the same directory.

```
Usage: ./pigx-dev.sh [ subcommand ] [-v]

Available subcommands are:
b|build Initialise pipeline from git folder, running bootstrap and configure
c|clean Remove test files
t|test Run tests

-v|--version Show toolkit version
-h|--help Show this help
```


113 changes: 113 additions & 0 deletions toolkit/pigx-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#!/bin/bash
# -*- bash -*-
# PiGx Developer Toolkit.
#
# Copyright © 2021 Alexander Blume <[email protected]>
#
# This file is provided to help the developers of the PiGx Pipelines. #
# Change History
# 08/06/2021 Alexander Blume Update help message.
# Add release and sign.
#
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.



VERSION="0.0.3"
DESCRIPTION="PiGx developer toolkit"

usage() {
# display help message
echo "Usage: $0 [ subcommand ] [-v]"
echo
echo "Available subcommands are:"
echo " b|build Initialise pipeline from git folder, running bootstrap and configure"
echo " c|clean Remove test files"
echo " t|test Run tests"
echo " r|release Create release"
echo " s|sign Sign tag and release"
echo
echo " -v|--version Show toolkit version"
echo " -h|--help Show this help"
}

build() {
## initialisation to run pipeline both from git folder and
## from any folder with absolute path as [git-folder]/local_install/pigx-bsseq ...
./bootstrap.sh
./configure --prefix=$PWD/local_install
make install
}

clean() {
# remove test files
make clean
}

test() {
# run all tests
make check
}

release() {
# bundle release
make distcheck
}

sign() {
# sign the release
git tag --sign v$(cat VERSION)
gpg --detach-sign pigx_*-$(cat VERSION).tar.gz
}

default() {
local OPTIND
while getopts ":v" opt; do
case "${opt}" in
v)
echo -e "${DESCRIPTION}, Version v${VERSION}"
exit 1
;;
esac
done
shift $((OPTIND-1))
usage
}


case "$1" in
b|build)
build
;;
c|clean)
clean
;;
t|test)
test
;;
r|release)
release
;;
s|sign)
sign
;;
*)
default "$@"
exit 1
;;
esac