Skip to content

Commit 252b1ed

Browse files
committed
Add a version command.
The git tag/revision is saved when running "make install", and can be displayed using "dokku version".
1 parent 9953030 commit 252b1ed

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

‎Makefile‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,23 @@ SSHCOMMAND_URL ?= https://raw.github.com/progrium/sshcommand/master/sshcommand
22
PLUGINHOOK_URL ?= https://s3.amazonaws.com/progrium-pluginhook/pluginhook_0.1.0_amd64.deb
33
STACK_URL ?= github.com/progrium/buildstep
44
PREBUILT_STACK_URL ?= https://s3.amazonaws.com/progrium-dokku/progrium_buildstep_79cf6805cf.tgz
5+
DOKKU_ROOT ?= /home/dokku
56

6-
.PHONY: all install copyfiles plugins dependencies sshcommand pluginhook docker aufs stack count
7+
.PHONY: all install copyfiles version plugins dependencies sshcommand pluginhook docker aufs stack count
78

89
all:
910
# Type "make install" to install.
1011

11-
install: dependencies stack copyfiles plugins
12+
install: dependencies stack copyfiles plugins version
1213

1314
copyfiles:
1415
cp dokku /usr/local/bin/dokku
1516
mkdir -p /var/lib/dokku/plugins
1617
cp -r plugins/* /var/lib/dokku/plugins
1718

19+
version:
20+
git describe --tags > ${DOKKU_ROOT}/VERSION
21+
1822
plugins: pluginhook docker
1923
dokku plugins-install
2024

‎plugins/00_dokku-standard/commands‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,20 @@ case "$1" in
6666
fi
6767
;;
6868

69+
version)
70+
cat "$DOKKU_ROOT/VERSION" || {
71+
echo "Unable to determine dokku's version" 2>&1
72+
exit 1
73+
}
74+
;;
75+
6976
help)
7077
cat && cat<<EOF
7178
delete <app> Delete an application
7279
logs <app> [-t] Show the last logs for an application (-t follows)
7380
run <app> <cmd> Run a command in the environment of an application
7481
url <app> Show the URL for an application
82+
version Print dokku's version
7583
EOF
7684
;;
7785

0 commit comments

Comments
 (0)