Skip to content

Commit 09cb986

Browse files
authored
Merge pull request #246 from github/2.7.0-release
Bump version: 2.7.0
2 parents 6887327 + 16b6606 commit 09cb986

File tree

4 files changed

+45
-2
lines changed

4 files changed

+45
-2
lines changed

bin/ghe-restore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,9 @@ else
294294
ghe-restore-es-${GHE_BACKUP_STRATEGY} "$GHE_HOSTNAME" 1>&3
295295
fi
296296

297+
echo "Restoring hookshot logs ..."
298+
ghe-restore-es-hookshot "$GHE_HOSTNAME" 1>&3
299+
297300
# Restart an already running memcached to reset the cache after restore
298301
if [ "$GHE_VERSION_MAJOR" -ge 2 ]; then
299302
echo "Restarting memcached ..." 1>&3
@@ -334,7 +337,8 @@ else
334337
echo "Restoring Git over SSH host keys ..."
335338
ghe-ssh "$GHE_HOSTNAME" -- "sudo tar -xpf - -C /data/user/common" < "$GHE_RESTORE_SNAPSHOT_PATH/ssh-host-keys.tar" 1>&3
336339
ghe-ssh "$GHE_HOSTNAME" -- "sudo chown babeld:babeld /data/user/common/ssh_host_*" 1>&3
337-
ghe-ssh "$GHE_HOSTNAME" -- "/usr/local/share/enterprise/ghe-cluster-config-update -s" 1>&3
340+
echo "if [ -f /usr/local/share/enterprise/ghe-cluster-config-update ]; then /usr/local/share/enterprise/ghe-cluster-config-update -s; else /usr/local/bin/ghe-cluster-config-update -s; fi" |
341+
ghe-ssh "$GHE_HOSTNAME" -- /bin/sh 1>&3
338342
fi
339343

340344
echo "Completed restore of $GHE_HOSTNAME from snapshot $GHE_RESTORE_SNAPSHOT"

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
github-backup-utils (2.7.0) UNRELEASED; urgency=medium
2+
3+
* GitHub Enterprise 2.7.0 support
4+
5+
-- Sergio Rubio <rubiojr@github.com> Wed, 03 Aug 2016 20:25:31 +0200
6+
17
github-backup-utils (2.6.4) UNRELEASED; urgency=medium
28

39
* Instrument/benchmark backups #238
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
#/ Usage: ghe-restore-es-hookshot
3+
#/ Restores a backup of hookshot logs to ElasticSearch.
4+
#/
5+
#/ Note: This command typically isn't called directly. It's invoked by
6+
#/ ghe-restore.
7+
set -e
8+
9+
# Bring in the backup configuration
10+
. $( dirname "${BASH_SOURCE[0]}" )/ghe-backup-config
11+
12+
# Show usage and bail with no arguments
13+
[ $# -lt 1 ] && print_usage
14+
15+
bm_start "$(basename $0)"
16+
17+
GHE_HOSTNAME="$1"
18+
19+
# Perform a host-check and establish GHE_REMOTE_XXX variables.
20+
ghe_remote_version_required "$GHE_HOSTNAME"
21+
22+
last_index=$(ghe-ssh "$GHE_HOSTNAME" 'curl -s "localhost:9201/_cat/indices/hookshot-logs-*"' | cut -d ' ' -f 3 | sort | tail -1)
23+
24+
indices=$(ls -1 $GHE_DATA_DIR/$GHE_RESTORE_SNAPSHOT/hookshot/*.gz 2>/dev/null | xargs -I{} -n1 basename {} .gz)
25+
26+
for index in $indices; do
27+
if [ -z "$last_index" ] || ! [ $index \< $last_index ]; then
28+
ghe_verbose "* Restoring $index"
29+
gzip -dc $GHE_DATA_DIR/$GHE_RESTORE_SNAPSHOT/hookshot/$index.gz | ghe-ssh "$GHE_HOSTNAME" "/usr/local/share/enterprise/ghe-es-load-json 'http://localhost:9201/$index'" 1>&3
30+
fi
31+
done
32+
33+
bm_end "$(basename $0)"

share/github-backup-utils/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.6.4
1+
2.7.0

0 commit comments

Comments
 (0)