mirror of
https://github.com/inofix/maestro.py.git
synced 2026-02-05 09:45:24 +01:00
Stub Files
Add a first bunch of files to start with.
This commit is contained in:
61
git-hooks/pre-commit
Executable file
61
git-hooks/pre-commit
Executable file
@@ -0,0 +1,61 @@
|
||||
#!/bin/sh
|
||||
# Licensed under the "Fair License (Fair)" (2015, Fair License: http://fairlicense.org/) (or any other fucking license that is equivalent...)
|
||||
# (C) 2017 Michael Lustenberger (mic at inofix.ch)
|
||||
# Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument.
|
||||
# DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
|
||||
#
|
||||
# Intended Usage:
|
||||
# * Tag your git repo with e.g. `git tag -a 0.1`
|
||||
# * Copy this script to your .git/hooks/ (and mark it executable..)
|
||||
# * Any time you want to manually set a version (release), commit all changes,
|
||||
# set the version in $version_file/$setup_file, tag repo to the release
|
||||
# (do not push it, we will re-tag again later) and commit the change of
|
||||
# the version, then tag again with '-f' and push everything
|
||||
# If someone has a simpler, yet equally powerful, idea, please send it to
|
||||
# me (mic at inofix.ch).
|
||||
|
||||
# always find the version here..
|
||||
version_file=version.txt
|
||||
# send a copy to PyPI setup.py
|
||||
setup_file=setup.py
|
||||
|
||||
if ! git describe >/dev/null 2>&1 ; then
|
||||
echo "This project has no version info yet! Use 'git tag -a <version>' to start versioning.."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! git diff --quiet HEAD ; then
|
||||
# something has changed in the repository
|
||||
if git diff --quiet ; then
|
||||
# this means the changes were actually added
|
||||
|
||||
new_version=`git describe`
|
||||
old_version=`grep "^Internal Version: .*$" $version_file | awk '{print $3}'`
|
||||
|
||||
if [ "$new_version" != "$old_version" ] ; then
|
||||
# do nothing if a version was tagged manually
|
||||
|
||||
# convert the git version to a PEP440 compliant form
|
||||
i=0
|
||||
for v in `echo $new_version | tr "-" " "` ; do
|
||||
eval "v_$i=$v"
|
||||
i=$(($i+1))
|
||||
done
|
||||
|
||||
pypi_version="$v_0"
|
||||
if [ -n "$v_1" ] && [ -n "$v_2" ] ; then
|
||||
pypi_version="$v_0.dev$v_1+$v_2"
|
||||
fi
|
||||
|
||||
# set it into version.txt and setup.py
|
||||
echo "Something has changed, count up the version to $new_version ($pypi_version resp.)"
|
||||
|
||||
sed -i 's;^Internal Version: .*$;Internal Version: '${new_version}';' $version_file
|
||||
sed -i 's;^Official Version: .*$;Official Version: '${pypi_version}';' $version_file
|
||||
git add $version_file
|
||||
sed -i "s; version='.*',; version='${pypi_version}',;" $setup_file
|
||||
git add $setup_file
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
18
maestro.py
Normal file
18
maestro.py
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
PURPOSE: This tool allows for a modular organization of server
|
||||
infrastructures by connecting a bunch of git-repositories
|
||||
containing the configuration as meta-data and automatization
|
||||
manager files.
|
||||
DEPENDENCY: python >3, see requirements.txt
|
||||
PLATTFORM: currently only unix/linux is supported
|
||||
AUTHOR(S): david weber ??
|
||||
michael lustenberger inofix.ch
|
||||
VERSION: see version.txt
|
||||
COPYRIGHT: (C) 2018 by Michael Lustenberger, David Weber, and INOFIX GmbH
|
||||
|
||||
This program is free software under the GNU General Public
|
||||
License (>=v2).
|
||||
"""
|
||||
|
||||
1
requirements.txt
Normal file
1
requirements.txt
Normal file
@@ -0,0 +1 @@
|
||||
ConfigArgParse
|
||||
2
version.txt
Normal file
2
version.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
Internal Version: 0.1
|
||||
Official Version: 0.1
|
||||
Reference in New Issue
Block a user