diff --git a/toolkit/README.md b/toolkit/README.md new file mode 100644 index 0000000..ec075da --- /dev/null +++ b/toolkit/README.md @@ -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 +``` + + diff --git a/toolkit/pigx-dev.sh b/toolkit/pigx-dev.sh new file mode 100755 index 0000000..93b735b --- /dev/null +++ b/toolkit/pigx-dev.sh @@ -0,0 +1,113 @@ +#!/bin/bash +# -*- bash -*- +# PiGx Developer Toolkit. +# +# Copyright © 2021 Alexander Blume +# +# 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 . + + + +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 + +