diff --git a/.gitignore b/.gitignore index ba74660..8cd1d84 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ __pycache__/ *.py[cod] +# Release files +release/ + # C extensions *.so diff --git a/scripts/create-release.py b/scripts/create-release.py new file mode 100644 index 0000000..f2bdd63 --- /dev/null +++ b/scripts/create-release.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python2.4 +""" +This script is used to create the release file. +""" + +# Imports ###################################################################### +import os + + +# Metadata ##################################################################### +__author__ = "Timothy McFadden" +__creationDate__ = "06/08/2015" +__license__ = "MIT" + + +# Globals ###################################################################### +THIS_DIR = os.path.abspath(os.path.dirname(__file__)) +SRC = os.path.join(THIS_DIR, "..", "src", "storcli_check.py") +DEST_DIR = os.path.join(THIS_DIR, "..", "release") + +if __name__ == '__main__': + import imp + import tarfile + + # Read the version from our project + mod = imp.load_source("storcli_check", SRC) + + destination = os.path.join(DEST_DIR, "storcli_check-%s.tar.gz" % mod.__version__) + with tarfile.open(destination, "w:gz") as tar: + tar.add(SRC, "storcli_check.py") + + print "[%s] created" % destination