Enables integration between Namely and external HRIS apps.
This project assumes Docker for local development. You may be able to use it in a more traditional local setup, but it may require some tweaking of environment variables or configuration.
You will need a Docker environment to run this project locally. If you are on
Linux, install docker
and docker-compose
with your package manager.
If you are on OS X or Windows, you will need to install additional tools. The
simplest way to install these is the with Docker Toolbox. Once the toolbox is
installed, we'll be interacting with it from the shell. You'll likely want to
add eval "$(docker-machine env default)"
to your shell initialization scripts
to be sure your docker-machine
environment is always configured.
A complete docker tutorial is out of scope here, but please be sure to read the documentation for your platform.
This application will use three docker containers; one each for the database,
the web process, and the worker process. We use docker-compose
to control them
all in concert.
cp .sample.env .env
docker-compose build
docker-compose run web rake db:setup
We can start all of the containers with the following command:
docker-compose up
This will make the web app available. If you are using Linux, it will be at http://localhost:3000.
If you are using OS X or Windows, you will need to know
the IP of the virtual machine that docker is running in. You can get this with
docker-machine ip default
. This seems to be stable between reboots, so you may
want to set up an entry in your hosts file for docker.dev
or similar. On my
machine, the app is available at http://192.168.99.100:3000.
The tests are run via docker as well.
docker-compose run web rake
To make this process as seamless as possible, you can use local binstubs to pass
your usual development environment commands (rake
, rspec
, rails
) through
docker-compose for you.
This project includes these binstubs in the local_bin
directory, which can be
added to your PATH
.
The app interfaces with the Namely API and external APIs for the supported integrations. At a minimum you will need an account on a Namely sandbox. Request access to a sandbox from Attila.
Once you have access to your Namely sandbox, you will need to register your development environment instance with that sandbox.
- Log in to your sandbox
- In the drop-down menu next to your avatar, select "API".
- Click "New API Client"
- Enter your Namely sandbox URL in Website (e.g.
https://thoughtbot-sandbox.namely.com
). - Enter your local development oauth callback URL in "Redirect URI" (e.g.
http://docker.dev:3000/session/oauth_callback
). - Click submit and note the "Client Identifier" and "Client Secret" provided.
- Edit your
.env
file and input the tokens from step 5 as yourNAMELY_CLEINT_ID
andNAMELY_CLIENT_SECRET
.
Cloud Elements is used to wrap NetSuite's SOAP API in a JSON REST API that is much easier to consume. You will need access to the Cloud Elements UI, which you can request from Attila.
Once you have access, you can configure your Cloud Elements client.
- Log in to Cloud Elements
- On the right side of the header, click "secrets".
- Copy and paste the
Org Secret
andUser Secret
to the.env
file asCLOUD_ELEMENTS_ORGANIZATION_SECRET
andCLOUD_ELEMENTS_USER_SECRET
, respectively.
There are shared accounts for the following services, which can be used when connecting to these services through the connect app or to log in to the external services themselves.
The credentials for these shared accounts can be found in the comments of this Trello card.
Overview documentation on the integrations may be located in the /doc
directory of this repository.
When changing feature specs that make API calls, you will need to rebuild one or
more API fixtures (in spec/fixtures
). When running these specs,
you will have to set the following environment variables in your .env
file:
TEST_JOBVITE_KEY
andTEST_JOBVITE_SECRET
: A valid Jobvite API key and secret.TEST_NAMELY_SUBDOMAIN
: The subdomain of a Namely sandbox account, e.g. if the account is atfoobar.namely.com
, you would set this tofoobar
.TEST_NAMELY_ACCESS_TOKEN
: A valid access token for the Namely sandbox account specified byTEST_NAMELY_SUBDOMAIN
.TEST_NAMELY_AUTH_CODE
: An OAuth auth code for the Namely sandbox account specified byTEST_NAMELY_SUBDOMAIN
.
To import newly hired Jobvite candidates for all users, run:
docker-compose run web rake jobvite:import
To export Namely profile data to NetSuite, run:
docker-compose run web rake net_suite:export
These tasks can be invoked by a cron job or otherwise scheduled to regularly import or export data.