Review Links & Servers

We have 3 virtuals we can use to create review links for clients. They both use a dynamic vhost configuration. Adding a site works the same as it does on dev2/dev3 ... minus the need for a "web" directory.

TIP

See Confluence Review Links page for credentials

wlreview4.com - web8

For insight into how the create-project and delete-project commands work on the server:

  1. Shell into the server.
$ ssh wlion@web8.wlion.com
  1. Change directories into the ~/setup-project directory.
$ cd ~/setup-project

Explore the files in this directory (particularly the Makefile).

Add a New SSH User

  1. Shell into the server.

$ ssh wlion@web8.wlion.com Edit the ~/.ssh/authorized_keys file.

$ vi ~/.ssh/authorized_keys
  1. Add the user's public SSH key to the end of the file.

  2. Save and close the file for the changes to take effect.

Create a New Project

To create a new project on wlreview4.com:

  1. Shell into the server.
$ ssh wlion@web8.wlion.com
  1. Create the bare git repo, web root, database and serve config file.
$ create-project [PROJECT_NAME]

TIP

  1. Go to Confluence Review Links for the password when requested.
  2. The PROJECT_NAME will be used for the git repo, subdomain and database name for the project, so should be a lower case, dash-separated string.
  1. Import a SQL file for the database via Sequel Pro.

To check the success of your create-project script sftp to the the SQL server for web8 in Sequel Pro. You should now see a database with the name you used when you ran create-project. Select that database and import the SQL file for your project if you have data ready.

Setup Local Git Push for Review

  1. Add a new review branch to the project in GitHub.
$ git checkout master
$ git pull
$ git checkout -b review
$ git push origin review
  1. Setup a new remote for Git locally.
$ git remote add review wlion@web8.wlion.com:git/PROJECT_NAME.git
  1. Merge your changes into the review branch, resolve any conflicts and push up to the review branch in GitHub.
$ git checkout review
$ git pull
$ git merge MY_FEATURE_BRANCH
$ git push origin review
  1. Make sure you have the review branch checked out with the latest changes.
$ git checkout review
$ git pull
  1. Push to review (web8.wlion.com) server.
$ git push review

Delete a Project

  1. Shell into the server.
$ ssh wlion@web8.wlion.com
  1. Delete the project by project name.
$ delete-project PROJECT_NAME

wlreview2.com

To update wlreview2.com, we need to do this using our "gitwork" server, like so:

See credentials for gitwork server on Review Links Confluence page.

$ cd /var/www/vhosts-web5
$ git fetch
$ git checkout feature-branch-name

To add a site to either server:

Add directory and checkout.

$ cd /var/www/vhosts/
$ sudo mkdir **dir_name**
$ sudo chown wlion:wlion **dir_name**
$ cd **dir_name**
$ git clone https://github.com/wlion/__repo_name__.git .

Add/Update database for this site

WARNING

You'll need to add a "review" environment before using. The file path is generic, so check against $_SERVER['HTTP_HOST']. It will end with either wlreview2.com or wlreview3.com.

Directory Names

Let's standardize on using the JIRA issue key (lowercased) for the directory name. So if I was working on LVCMS-1, I would create a directory named lvcms-1 and the review link would be http://lvcms-1.wlreview3.com.