0

Ok so the task I am attempting to accomplish is this. I am part of a team that manages a github server for a large company. My boss has asked me to do some research and find out if there is a way to automate the installation of new releases of GitHub Enterprise.

I am aware that the Enterprise application can check for, and download, new releases.

What I want to know is if there is a way, some sort of script, or anything else, that will enable my team to not have to manually run an installation of the new releases.

osowskit
  • 5,904
  • 2
  • 29
  • 38
ChrisB.
  • 3
  • 4

1 Answers1

0

Update 21, June 2016

Based on a new feature added recently to Github Enterprise. I'm updating this answer in case it helps other peeps in future

Github Enterprise 2.6.4 release notes mentions

  • Prompt-less upgrades can now be performed by passing the -y argument to ghe-upgrade

So basically you don't need to do simulate user input anymore. I've added this to the answer below


Not sure if there's an existing script but you could just create your own

  • Run ghe-update-check on the server
  • Parse the result from the /var/lib/ghe-updates/ghe-update-check.status
  • After this you basically execute the scripts mentioned in the upgrade docs
  • Add checks if you just want minor releases to be upgraded automatically
  • If an update exists then just download it curl -L -O https://github-enterprise.s3.amazonaws.com/ami/updates/<package-name>.pkg
  • Might be a good idea to enable maintenance mode before starting the upgrade ghe-maintenance -s
  • Run ghe-upgrade -y <package-name>.pkg (The -y option is a prompt-less upgrade. Only available in newer versions 2.6.4+ however)
  • Once it restarts after the upgrade disable maintenance mode ghe-maintenance -u
  • Put the whole script in a cron job to check for updates as often as you want
FearlessHyena
  • 3,527
  • 33
  • 39
  • Sounds pretty straightforward when you put it that way. What about the response part when you have to type y or n? – ChrisB. Apr 28 '16 at 19:59
  • hmm since ghe-upgrade doesn't have a silent mode you might have to use expect to simulate user input it seems quite straightforward http://stackoverflow.com/questions/14670716/simulate-user-input-in-bash-script – FearlessHyena Apr 28 '16 at 21:08