This is the echo service.
Welcome to Echo.
Before you can run echo you need:
- To install and set up the IDM service
- To install and set up the LG bin
- For live data: an invitation the LG Team on Heroku
curl -o- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
npm install -g avn avn-nvm
avn setup
3. Setup and run mehserve.
Figure out which port you intend to use and create the mehserve config file:
echo 9005 > ~/.mehserve/echo.learnersguild
export NODE_ENV=development
Take out all comments in your final version. Example:
PORT=9005
APP_BASE_URL=http://echo.learnersguild.dev
REDIS_URL=redis://localhost:6379
RETHINKDB_URL=rethinkdb://localhost:28015/echo_development
# IDM / JWT settings, including session extension
IDM_BASE_URL=http://idm.learnersguild.dev
JWT_PRIVATE_KEY="<get from IDM service>"
JWT_PUBLIC_KEY="<get from IDM service>"
# Slack / command CLI settings
CHAT_BASE_URL=https://slack.com
CHAT_API_TOKEN=<get from dev slack instance>
CLI_COMMAND_TOKEN=<get from echo slash commands app>
# external API settings
GITHUB_ORG_ADMIN_TOKEN="<GitHub token with permissions in LearnersGuild, GuildCrafts, and GuildCraftsTesting>"
GITHUB_CRAFTS_REPO="https://github.com/GuildCraftsTesting/web-development-js-testing"
HEROKU_API_TOKEN="<Heroku API token with permissions on all of our apps>"
npm install
npm run db:create
NODE_ENV=test npm run db:create
npm run db:migrate:up
NODE_ENV=test npm run db:migrate:up
If you need to sync prod databases to your local setups: You'll need to be invited to the LG Team on Heroku for this to work. install heroku locally and use the heroku cli to log in locally. Run the heroku access command to confirm that you have access:
heroku access -a lg-echo
Use the Resync command to sync the live echo and idm data to your local environment. You must have LG bin cloned and running for this to work.
To ensure the bin environments are ready for syncing with the database:
ls -l /usr/local/bin/rethinkdb-export
If you don't have /usr/local/bin/rethinkdb-export
you'll need to install pip
and then use it to install the python rethinkdb drivers
brew install pip
sudo pip install rethinkdb
WARNING You have access to the production systems and data now. Please be careful. You now have the power to cause a lot of damage.
In your bin
folder:
./resyncdb lg-echo echo_development
./resyncdb lg-idm idm_development
NOTE: you'll need mehserve, idm and this server all running at the same time for things to work.
npm start
Visit the server in your browser:
open http://echo.learnersguild.dev
Start the workers
npm run workers
npm run workers:cycleLaunched
NOTE: If you want to use /slash
commands from the development Slack instance, you'll need to set up localtunnel, as well:
npm install -g localtunnel
lt --port $(cat ~/.mehserve/echo.learnersguild) --subdomain slackslash
We use Codeship for continuous integration. The following files are responsible for CI configuration:
Dockerfile
: basic Docker image for the appcodeship-services.yml
: similar todocker-compose.yml
, but for CIcodeship-steps.yml
: the steps to run on each service for CIapp.env.encrypted
: encrypted environment vars for the app (e.g.,NPM_AUTH_TOKEN
)herokudeployment.env.encrypted
: encrypted environment vars for Heroku deployment (e.g.,HEROKU_API_KEY
)
See the LICENSE file.