From b7ab589f6e17952bf2ad38d12c14ca42aaefd75e Mon Sep 17 00:00:00 2001 From: Joshua Arulsamy Date: Mon, 10 Aug 2020 02:16:11 -0600 Subject: [PATCH] :art: Switch to shell scripts for deployment --- PlexBot/__version__.py | 7 +++++-- deploy/build.py | 8 -------- deploy/build.sh | 14 ++++++++++++++ deploy/push.py | 8 -------- deploy/push.sh | 14 ++++++++++++++ 5 files changed, 33 insertions(+), 18 deletions(-) delete mode 100644 deploy/build.py create mode 100755 deploy/build.sh delete mode 100755 deploy/push.py create mode 100755 deploy/push.sh diff --git a/PlexBot/__version__.py b/PlexBot/__version__.py index e2acb55..8f25dfd 100644 --- a/PlexBot/__version__.py +++ b/PlexBot/__version__.py @@ -1,2 +1,5 @@ -"""Track version number of package""" -VERSION = "0.0.6" +"""Track version number of package.""" +VERSION = "0.0.7" + +if __name__ == "__main__": + print(VERSION) diff --git a/deploy/build.py b/deploy/build.py deleted file mode 100644 index 78c9326..0000000 --- a/deploy/build.py +++ /dev/null @@ -1,8 +0,0 @@ -import os -import sys - -sys.path.append("PlexBot") - -from __version__ import VERSION - -sys.exit(os.system(f"docker build -t jarulsamy/plex-bot:{VERSION} .")) diff --git a/deploy/build.sh b/deploy/build.sh new file mode 100755 index 0000000..9fe1c36 --- /dev/null +++ b/deploy/build.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +VERSION=$(python PlexBot/__version__.py) + +docker build -t "jarulsamy/plex-bot:$VERSION" . + +if [ $? -eq 0 ] +then + echo "Successfully build docker image." + exit 0 +else + echo "Failed to build docker image." >&2 + exit 1 +fi diff --git a/deploy/push.py b/deploy/push.py deleted file mode 100755 index 98fc956..0000000 --- a/deploy/push.py +++ /dev/null @@ -1,8 +0,0 @@ -import os -import sys - -sys.path.append("PlexBot") - -from __version__ import VERSION - -sys.exit(os.system(f"docker push jarulsamy/plex-bot:{VERSION}")) diff --git a/deploy/push.sh b/deploy/push.sh new file mode 100755 index 0000000..ce37735 --- /dev/null +++ b/deploy/push.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +VERSION=$(python PlexBot/__version__.py) + +docker push "jarulsamy/plex-bot:$VERSION" + +if [ $? -eq 0 ] +then + echo "Successfully pushed docker image." + exit 0 +else + echo "Failed to push docker image." >&2 + exit 1 +fi