Commit e9070fff authored by Matthias Larisch's avatar Matthias Larisch

Use deploy script, generate and include revision

On deploy, a revision file will be generated that is included in code to
define SRC_REVISION with current git revision hash.
parent fede879e
......@@ -58,7 +58,9 @@ deploy:
# instead.
# - mkdir -p ~/.ssh
# - '[[ -f /.dockerenv ]] && echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts'
- ssh gitolite@banana.foodsharing.de 'cd /var/www/lmr-beta/www; git fetch gitlab && git checkout gitlab/master && composer install --no-dev'
- scp deploy.sh gitolite@banana.foodsharing.de:/var/www/lmr-beta
- ssh gitolite@banana.foodsharing.de 'cd /var/www/lmr-beta/www; ../deploy.sh'
only:
- master
......
......@@ -18,6 +18,13 @@ if (!defined('SOCK_URL')) {
}
date_default_timezone_set("Europe/Berlin");
/*
* Read revision from revision file.
* It is supposed to define SRC_REVISION.
*/
if (file_exists('revision.inc.php')) {
require_once('revision.inc.php');
}
/*
* Configure Raven (sentry.io client) for remote error reporting
......@@ -27,4 +34,7 @@ if (defined('SENTRY_URL')) {
$client = new Raven_Client(SENTRY_URL);
$client->install();
$client->tags_context(array('FS_ENV' => $FS_ENV));
if (defined('SRC_REVISION')) {
$client->setRelease(SRC_REVISION);
}
}
#!/bin/sh
git fetch gitlab && git checkout -f gitlab/master && composer install --no-dev
REV=$((git rev-list HEAD --max-count=1))
echo "<?php" > revision.inc.php
echo "define('SRC_REVISION', '"$REV"');" >> revision.inc.php
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment