Skip to content

Commit

Permalink
GitHub Enterprise Server
Browse files Browse the repository at this point in the history
Signed-off-by: bwestover <bwestover@github.com>
  • Loading branch information
gnawhleinad authored and bwestover committed Jan 10, 2019
1 parent 4dd62a3 commit 5e551d2
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 34 deletions.
23 changes: 13 additions & 10 deletions README.md
@@ -1,18 +1,19 @@
# GitHub Enterprise Backup Utilities
# GitHub Enterprise Server Backup Utilities

This repository includes backup and recovery utilities for [GitHub Enterprise][1].
This repository includes backup and recovery utilities for
[GitHub Enterprise Server][1].

**Note**: the [GitHub Enterprise version requirements](docs/requirements.md#github-enterprise-version-requirements) have
**Note**: the [GitHub Enterprise Server version requirements][2] have
changed starting with Backup Utilities v2.13.0, released on 27 March 2018.

### Features

Backup Utilities implement a number of advanced capabilities for backup
hosts, built on top of the backup and restore features already included in
GitHub Enterprise.
GitHub Enterprise Server.

- Complete GitHub Enterprise backup and recovery system via two simple utilities:<br>
`ghe-backup` and `ghe-restore`.
- Complete GitHub Enterprise Server backup and recovery system via two simple
utilities:<br>`ghe-backup` and `ghe-restore`.
- Online backups. The GitHub appliance need not be put in maintenance mode for
the duration of the backup run.
- Incremental backup of Git repository data. Only changes since the last
Expand All @@ -31,7 +32,7 @@ GitHub Enterprise.
- **[Requirements](docs/requirements.md)**
- **[Backup host requirements](docs/requirements.md#backup-host-requirements)**
- **[Storage requirements](docs/requirements.md#storage-requirements)**
- **[GitHub Enterprise version requirements](docs/requirements.md#github-enterprise-version-requirements)**
- **[GitHub Enterprise Server version requirements](docs/requirements.md#github-enterprise-version-requirements)**
- **[Getting started](docs/getting-started.md)**
- **[Using the backup and restore commands](docs/usage.md)**
- **[Scheduling backups](docs/scheduling-backups.md)**
Expand All @@ -43,8 +44,10 @@ GitHub Enterprise.

If you find a bug or would like to request a feature in Backup Utilities, please
open an issue or pull request on this repository. If you have a question related
to your specific GitHub Enterprise setup or would like assistance with backup
site setup or recovery, please contact our [Enterprise support team][2] instead.
to your specific GitHub Enterprise Server setup or would like assistance with
backup site setup or recovery, please contact our [Enterprise support team][3]
instead.

[1]: https://enterprise.github.com
[2]: https://enterprise.github.com/support/
[2]: docs/requirements.md#github-enterprise-version-requirements
[3]: https://enterprise.github.com/support/
6 changes: 3 additions & 3 deletions RELEASING.md
@@ -1,12 +1,12 @@
# Making a Backup Utilities release

Starting with Backup Utilities v2.13.0, all major releases will follow GitHub Enterprise releases and the version support is inline with that of the [GitHub Enterprise upgrade requirements](https://help.github.com/enterprise/admin/guides/installation/about-upgrade-requirements/) and as such, support is limited to three versions of GitHub Enterprise: the version that corresponds with the version of Backup Utilities, and the two releases prior to it.
Starting with Backup Utilities v2.13.0, all major releases will follow GitHub Enterprise Server releases and the version support is inline with that of the [GitHub Enterprise Server upgrade requirements](https://help.github.com/enterprise/admin/guides/installation/about-upgrade-requirements/) and as such, support is limited to three versions of GitHub Enterprise Server: the version that corresponds with the version of Backup Utilities, and the two releases prior to it.

For example, Backup Utilities 2.13.0 can be used to backup and restore all patch releases from 2.11.0 to the latest patch release of GitHub Enterprise 2.13. Backup utilities 2.14.0 will be released when GitHub Enterprise 2.14.0 is released and will then be used to backup all releases of GitHub Enterprise from 2.12.0 to the latest patch release of GitHub Enterprise 2.14.

There is no need to align Backup Utilities patch releases with GitHub Enterprise patch releases.
There is no need to align Backup Utilities patch releases with GitHub Enterprise Server patch releases.

When making a `.0` release, you will need to specify the minimum supported version of GitHub Enterprise that that release supports.
When making a `.0` release, you will need to specify the minimum supported version of GitHub Enterprise Server that that release supports.

## Automatic Process from chatops (internal to GitHub only) - Coming :soon:

Expand Down
4 changes: 2 additions & 2 deletions backup.config-example
@@ -1,6 +1,6 @@
# GitHub Enterprise backup configuration file
# GitHub Enterprise Server backup configuration file

# The hostname of the GitHub Enterprise appliance to back up. The host
# The hostname of the GitHub Enterprise Server appliance to back up. The host
# must be reachable via SSH from the backup host.
GHE_HOSTNAME="github.example.com"

Expand Down
24 changes: 12 additions & 12 deletions bin/ghe-host-check
@@ -1,14 +1,14 @@
#!/usr/bin/env bash
#/ Usage: ghe-host-check [-h] [--version] [<host>]
#/
#/ Verify connectivity with the GitHub Enterprise host.
#/ Verify connectivity with the GitHub Enterprise Server host.
#/
#/ OPTIONS:
#/ -h | --help Show this message.
#/ --version Display version information.
#/ <host> The GitHub Enterprise host to check. When no <host> is
#/ provided, the $GHE_HOSTNAME configured in backup.config
#/ is assumed.
#/ <host> The GitHub Enterprise Server host to check. When no
#/ <host> is provided, the $GHE_HOSTNAME configured in
#/ backup.config is assumed.
#/

set -e
Expand Down Expand Up @@ -70,7 +70,7 @@ if [ $rc -ne 0 ]; then
echo "* https://enterprise.github.com/help/articles/adding-an-ssh-key-for-shell-access" 1>&2
;;
101)
echo "Error: couldn't read GitHub Enterprise fingerprint on '$host' or this isn't a GitHub appliance." 1>&2
echo "Error: couldn't read GitHub Enterprise Server fingerprint on '$host' or this isn't a GitHub appliance." 1>&2
;;
1)
if [ "${port:-22}" -eq 22 ] && echo "$output" | grep "use port 122" >/dev/null; then
Expand All @@ -84,20 +84,20 @@ if [ $rc -ne 0 ]; then
exit $rc
fi

version=$(echo "$output" | sed -n 's/GitHub Enterprise version \(.*\)/\1/p')
version=$(echo "$output" | sed -E -n 's/GitHub Enterprise( Server)? version (.*)/\2/p')

if [ -z "$version" ]; then
echo "Error: failed to parse version on '$host' or this isn't a GitHub appliance." 1>&2
exit 2
fi

# Block restoring snapshots to older releases of GitHub Enterprise
# Block restoring snapshots to older releases of GitHub Enterprise Server
if [ -n "$GHE_RESTORE_SNAPSHOT_PATH" ]; then
snapshot_version=$(cat $GHE_RESTORE_SNAPSHOT_PATH/version)
# shellcheck disable=SC2046 # Word splitting is required to populate the variables
read -r snapshot_version_major snapshot_version_minor _ <<<$(ghe_parse_version $snapshot_version)
if [ "$(version $GHE_REMOTE_VERSION)" -lt "$(version $snapshot_version_major.$snapshot_version_minor.0)" ]; then
echo "Error: Snapshot can not be restored to an older release of GitHub Enterprise." >&2
echo "Error: Snapshot can not be restored to an older release of GitHub Enterprise Server." >&2
exit 1
fi
fi
Expand All @@ -112,17 +112,17 @@ if [ -z "$GHE_ALLOW_REPLICA_BACKUP" ]; then
fi

# backup-utils 2.13 onwards limits support to the current and previous two releases
# of GitHub Enterprise.
# of GitHub Enterprise Server.
supported_minimum_version="2.13.0"

if [ "$(version $version)" -ge "$(version $supported_minimum_version)" ]; then
supported=1
fi

if [ -z "$supported" ]; then
echo "Error: unsupported release of GitHub Enterprise detected." 1>&2
echo "Backup Utilities v$BACKUP_UTILS_VERSION requires GitHub Enterprise v$supported_minimum_version or newer." 1>&2
echo "Please update your GitHub Enterprise appliance or use an older version of Backup Utilities." 1>&2
echo "Error: unsupported release of GitHub Enterprise Server detected." 1>&2
echo "Backup Utilities v$BACKUP_UTILS_VERSION requires GitHub Enterprise Server v$supported_minimum_version or newer." 1>&2
echo "Please update your GitHub Enterprise Server appliance or use an older version of Backup Utilities." 1>&2
exit 1
fi

Expand Down
7 changes: 4 additions & 3 deletions debian/control
Expand Up @@ -8,14 +8,15 @@ Build-Depends: debhelper (>= 9), git, devscripts, moreutils, jq
Package: github-backup-utils
Architecture: any
Depends: ${misc:Depends}, rsync (>= 2.6.4), moreutils, jq
Description: Backup and recovery utilities for GitHub Enterprise
Description: Backup and recovery utilities for GitHub Enterprise Server
The backup utilities implement a number of advanced capabilities for backup
hosts, built on top of the backup and restore features already included in
GitHub Enterprise.
GitHub Enterprise Server.
.
These advanced features include:
.
Complete GitHub Enterprise backup and recovery system via two simple utilities:
Complete GitHub Enterprise Server backup and recovery system via two simple
utilities:
`ghe-backup` and `ghe-restore`.
Online backups. The GitHub appliance need not be put in maintenance mode for
the duration of the backup run.
Expand Down
4 changes: 2 additions & 2 deletions script/release
Expand Up @@ -408,7 +408,7 @@ if $PROGRAM_NAME == __FILE__
puts 'Updating changelog...'
update_changelog release_changes, DEB_PKG_NAME, version
release_body = "Includes general improvements & bug fixes"
release_body += " and support for GitHub Enterprise v#{version}" unless min_version.nil?
release_body += " and support for GitHub Enterprise Server v#{version}" unless min_version.nil?
release_changes.each do |c|
release_body += "\n* #{c}"
end
Expand All @@ -424,7 +424,7 @@ if $PROGRAM_NAME == __FILE__
tag "v#{version}", res['sha']

puts 'Creating release...'
release_title = "GitHub Enterprise Backup Utilities v#{version}"
release_title = "GitHub Enterprise Server Backup Utilities v#{version}"
res = create_release "v#{version}", 'master', release_title, release_body, true

# Tidy up before building tarball and deb pkg
Expand Down
2 changes: 1 addition & 1 deletion test/bin/ghe-negotiate-version
Expand Up @@ -3,5 +3,5 @@
# Emulates the remote GitHub ghe-negotiate-version command. Tests use this
# to assert that the command was executed.
set -e
echo "GitHub Enterprise version $GHE_TEST_REMOTE_VERSION"
echo "GitHub Enterprise Server version $GHE_TEST_REMOTE_VERSION"
echo "backup-utils $2 is supported."
2 changes: 1 addition & 1 deletion test/test-ghe-host-check.sh
Expand Up @@ -49,7 +49,7 @@ begin_test "ghe-host-check honours --help and -h flags"
)
end_test

begin_test "ghe-host-check detects unsupported GitHub Enterprise versions"
begin_test "ghe-host-check detects unsupported GitHub Enterprise Server versions"
(
set -e
# shellcheck disable=SC2046 # Word splitting is required to populate the variables
Expand Down

0 comments on commit 5e551d2

Please sign in to comment.