Wikimedia Apps/Team/RESTBase services for apps/Deployment process/Setup notes

Here are the detailed notes to get ready to update the deployment repo for our mobileapps RESTBase service on a Ubuntu box setup (inside a VirtualBox VM). Most also applies for setting up directly on a MacOS machine using Docker for Mac.

Basic Gerrit setup
This is more a reminder in case you setup a new machine, as I was doing that initially in a fresh Ubuntu install inside VirtualBox.

See Gerrit/Tutorial.

Setup source and deploy repos
Note that you have to set an environment variable here for the setup only (temporarily, no need to stick that into an rc script):

Git user name and email
You may also need to set your email and name in git if you haven't done so. See the Gerrit/Tutorial.

Git tag setup
Git tags are cryptographically signed and a GPG signing key is therefore required.

(or get GPG if you need it)

If no keys are listed or you just installed GPG, create a new signing key with:

Then configure the new key (or desired existing key) as the signing key for the mobileapps repo:

(add the   flag if you want to use this signing key for all repos)

For more information straight from the source: https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work

On MacOS
If running on Mac OS you can install Docker for Mac.

On Ubuntu
The easiest way to install Docker: Then, you need to add your user to the  group, follow the note at the end of the docker commands to do that. In other words: After all of that, reboot your VM. Then, you can run the tests inside Docker:

Optional: Nagios Setup
Checking the service with Nagios before building the deploy repo can help to identify problems and prevent deployment reverts.

(Note: These instructions are only the minimum required for command line usage, adapted from the Nagios Ubuntu Quickstart guide.)

Install prereqs:

Create a Nagios user:

Download, build, and install Nagios:

Download, build, and install nagios-plugin:

Start Nagios:

Download the WMF service checker plugin:

Now, to run the endpoint checks, start the service, then do:

Once that is all working you can prepare the deploy repo as part of the deployment process.