From 17c77147eaa8e3fa61465b7dc94ce35ca69c3e68 Mon Sep 17 00:00:00 2001 From: Ric Harvey Date: Tue, 19 Jun 2018 10:56:24 +0100 Subject: [PATCH] adding awesome tag/commit pull feature by Jaesin @ github --- docs/config_flags.md | 2 ++ scripts/start.sh | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/docs/config_flags.md b/docs/config_flags.md index a8d62ef..c1b8a6b 100644 --- a/docs/config_flags.md +++ b/docs/config_flags.md @@ -7,6 +7,8 @@ The following flags are a list of all the currently supported options that can b |--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | GIT_REPO | URL to the repository containing your source code. If you are using a personal token, this is the https URL without `https://` (e.g `github.com/project/`). For ssh prepend with `git@` (e.g `git@github.com/project.git`) | | GIT_BRANCH | Select a specific branch (optional) | +| GIT_TAG | Specify a specific git tag (optional) | +| GIT_COMMIT | Specify a specific git commit (optional) | | GIT_EMAIL | Set your email for code pushing (required for git to work) | | GIT_NAME | Set your name for code pushing (required for git to work) | | GIT_USE_SSH | Set this to 1 if you want to use git over SSH (instead of HTTP), useful if you want to use Bitbucket instead of GitHub | diff --git a/scripts/start.sh b/scripts/start.sh index 199276d..61c7e2d 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -58,6 +58,12 @@ if [ ! -d "/var/www/html/.git" ]; then fi fi ${GIT_COMMAND} /var/www/html || exit 1 + if [ ! -z "$GIT_TAG" ]; then + git checkout ${GIT_TAG} || exit 1 + fi + if [ ! -z "$GIT_COMMIT" ]; then + git checkout ${GIT_COMMIT} || exit 1 + fi if [ -z "$SKIP_CHOWN" ]; then chown -Rf nginx.nginx /var/www/html fi