This service has been discontinued.
Bocoup replaced the "People" service in late 2022 with another solution. This repository is archived, but can be forked or used for informational purposes.
Nest People
Dependencies
The following will need to be installed on your local development machine before you can use this workflow. All versions should be the latest available, as some required features may not be available in older versions.
- Ansible ^2.7.0
- Install
ansible
via apt (Ubuntu), yum (Fedora), homebrew (OS X), etc. See the Ansible installation instructions for detailed, platform-specific information.
- Install
- VirtualBox
- Download (All platforms)
- Install
virtualbox
via homebrew cask (OS X)
- Vagrant ^1.7.4
- Download (All platforms)
- Install
vagrant
via homebrew cask (OS X)
- vagrant-hostsupdater
- Install with
vagrant plugin install vagrant-hostsupdater
(All platforms)
- Install with
- node.js ^10.0.0
- grunt-cli
- Install with
npm install -g grunt-cli
- Alternatively, call grunt from
./node_modules/.bin/grunt
- Install with
Development
- Run
npm install
to install local dependencies. - Run
vagrant up
to start the Vagrant box.- If you had previously test-deployed a local
commit (see below), run
./deploy/run-playbook.sh vagrant-link vagrant
.
- If you had previously test-deployed a local
commit (see below), run
- Run
grunt
to build the site intopublic
to start the file-watcher and the live-reload process.- Browse to http://people.loc/
- Edit files in
src
and see the webpage update automatically.
- Run
npm test
if you only want to run lint and tests, without the watch task
Note that after changes to Gruntfile.js
or any of the Grunt-related files in
the grunt
directory, grunt
will need to be restarted.
Testing the build process
- Run
grunt build
to build the site intopublic
. - If you had previously test-deployed a local
commit (see below), run
./deploy/run-playbook.sh vagrant-link vagrant
. - Browse to http://people.loc/
- Re-build and refresh the browser to see changes.
Continuous Deployment
Merging to production
will automatically trigger a deploy to people.bocoup.com, and merging to master
will deploy to people-staging.bocoup.com.
In the (hopefully) rare instance you need to manually deploy the steps are below.
Manual Deployment
Test-deploying a local commit (Vagrant)
- Run
./deploy/run-playbook.sh deploy vagrant local=true commit=_____
where_____
is the local commit ref (branchname, SHA, etc) to deploy. For a complete list of options, see the deploy role docs.- Simulate deploying to production or staging by adding
env=production
orenv=staging
to the end of this command.
- Simulate deploying to production or staging by adding
- Browse to http://people.loc/
Deploying to staging
- Run
./deploy/run-playbook.sh deploy staging commit=_____
where_____
is the commit ref (branchname, SHA, etc) in GitHub. For a complete list of options, see the deploy role docs. - Enter your dploy sudo password when asked.
Deploying to production
- Run
./deploy/run-playbook.sh deploy production commit=_____
where_____
is the commit ref (branchname, SHA, etc) in GitHub. For a complete list of options, see the deploy role docs. - Enter your dploy sudo password when asked.
Running specific Ansible playbooks
Configuration
- deploy/ansible/group_vars/all.yml - Global variables. These settings are available to all playbooks and roles.
Playbooks and Roles:
- provision - Install all dependencies required
to build the base box.
- base role - Install Apt packages.
- configure - Configure the box and get services
set up. The following roles may be run individually via a role-named tag, eg.
--tags=nginx
: - vagrant-link - Link local working project
directory into the Vagrant box so local changes can be previewed on the
server. This playbook overrides the
deploy
playbook, and vice-versa. - deploy - Deploy the specified commit to the server and run the project build. For a complete list of options, see the deploy role docs. documentation](https://deployment-workflow.bocoup.com/#deploy-role) for an explanation of the available options.
- init - Run
provision
,configure
andvagrant-link
playbooks. Runs onvagrant up
.
Examples:
Note: more information is available on the Modern Web Deployment Workflow website.
# Run all configure playbook roles:
$ ./deploy/run-playbook.sh configure vagrant
# Run configure playbook role tagged "nginx":
# (valid tags are: configure, users, nginx)
$ ./deploy/run-playbook.sh configure vagrant --tags=nginx
# Deploy local branch "my-feature" to Vagrant for testing:
$ ./deploy/run-playbook.sh deploy vagrant local=true commit=my-feature
# Deploy branch "my-feature" from GitHub to staging:
$ ./deploy/run-playbook.sh deploy staging commit=my-feature
# Deploy master to production:
$ ./deploy/run-playbook.sh deploy production
After Deploying
You can see what version is deployed using this url or one like it:
https://people.bocoup.com/assets/build.txt
Configuration
API Root
The API urls are configured in /src/config.js
. These URLs are based the
value of the APP_ENV
environment variable, and defaults to that of the
development
environment. This file should only need to be changed if the
location of the API changes.
Authentication Providers
The list of authentication providers is set in /src/config.js
. These
are the providers a user can choose to authenticate with. Currently, the Bocoup
API only supports GitHub authentication.