From 252b1ed8b665c1c46247328572902a5e3a6bebbc Mon Sep 17 00:00:00 2001 From: Paul Lietar Date: Thu, 21 Nov 2013 00:01:38 +0000 Subject: [PATCH] Add a version command. The git tag/revision is saved when running "make install", and can be displayed using "dokku version". --- Makefile | 8 ++++++-- plugins/00_dokku-standard/commands | 8 ++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 69fcec755..e8415bdda 100644 --- a/Makefile +++ b/Makefile @@ -2,19 +2,23 @@ SSHCOMMAND_URL ?= https://raw.github.com/progrium/sshcommand/master/sshcommand PLUGINHOOK_URL ?= https://s3.amazonaws.com/progrium-pluginhook/pluginhook_0.1.0_amd64.deb STACK_URL ?= github.com/progrium/buildstep PREBUILT_STACK_URL ?= https://s3.amazonaws.com/progrium-dokku/progrium_buildstep_79cf6805cf.tgz +DOKKU_ROOT ?= /home/dokku -.PHONY: all install copyfiles plugins dependencies sshcommand pluginhook docker aufs stack count +.PHONY: all install copyfiles version plugins dependencies sshcommand pluginhook docker aufs stack count all: # Type "make install" to install. -install: dependencies stack copyfiles plugins +install: dependencies stack copyfiles plugins version copyfiles: cp dokku /usr/local/bin/dokku mkdir -p /var/lib/dokku/plugins cp -r plugins/* /var/lib/dokku/plugins +version: + git describe --tags > ${DOKKU_ROOT}/VERSION + plugins: pluginhook docker dokku plugins-install diff --git a/plugins/00_dokku-standard/commands b/plugins/00_dokku-standard/commands index 7a7252a20..5dd309c57 100755 --- a/plugins/00_dokku-standard/commands +++ b/plugins/00_dokku-standard/commands @@ -66,12 +66,20 @@ case "$1" in fi ;; + version) + cat "$DOKKU_ROOT/VERSION" || { + echo "Unable to determine dokku's version" 2>&1 + exit 1 + } + ;; + help) cat && cat< Delete an application logs [-t] Show the last logs for an application (-t follows) run Run a command in the environment of an application url Show the URL for an application + version Print dokku's version EOF ;;