I am running a Dokku app in production and need to know what version of the app is running on the server.
Is this possible with Dokku?
I am running a Dokku app in production and need to know what version of the app is running on the server.
Is this possible with Dokku?
There's no need for a plugin.
All apps in dokku are git bare repositories. Just connect to your server, switch to the app directory (mine are in /home/dokku/<app-name>
) and run a git log
. That should do the trick as well.
To get the current git commit hash for a dokku app just run
dokku config:get <myapp> GIT_REV
Yes, you can add the SHA1 of the latest git commit using this plugin: https://github.com/dokku-alt/dokku-alt/tree/master/plugins/dokku-git-rev
There are many other alternatives based on different scenarios and different environments. If you are deploying Node.JS apps and using package.json properly, you can easily parse out the version using the fs standard lib; JSON.parse(fs.readFileSync('package.json')).version
You can also do dokku config:show myapp | grep GIT_REV
to get it from the app's environment variables. The above command assumes your app name is myapp
.
The fastest way to do this is to issue this command:
dokku config:get GIT_REV
This queries the server for the git revision that was most recently deployed. During deployment the GIT hash is set as an envirnoment variable, that's why it's possible to get with config:get.
You can also just bash
into your doku app and echo $GIT_REV
© 2022 - 2024 — McMap. All rights reserved.
fatal: this operation must be run in a work tree
./home/dokku/<app-name>
contains a lot of various things like the app logs, its nginx config, its environnement, SSL certificates, etc. – Dustin