You'll need an installation of PostgreSQL (available here). Make note of the password for the postgres
user, because you'll need it later when setting up the database.
You'll need an installation of Node 5.10 (available here).
First, you'll need to make sure that you've got NodeJS 5.10.0 from here, or here for Mac OS.
Next, you'll need to download the repo:
$ git clone https://github.com/RoboticSwarmControl/SwarmControlRedux.git
Then, you need to install the application, go to the folder you have cloned, and install:
$ npm install
After, you need to build the client resources. This will copy around the vendor scripts and compile the games.
This is also when linting will occur.
$ npm run-script build
Make sure that you have the Heroku toolbelt installed.
You'll need a Postgres console and an administrator account. For Mac OS, use instruction here
Do this one time from the SQL server: create a swarm control database, a user, and privileges for that user on the database.
CREATE DATABASE swarm;
CREATE USER swarmcontrol WITH PASSWORD 'test';
GRANT ALL PRIVILEGES ON DATABASE swarm TO swarmcontrol;
Verify the user and the database are created:
\l
\du
Next, run the schema SQL file from your command line:
$ psql -h localhost -d swarm -U swarmcontrol --password -p 5432 -f database/schema.sql
Enter the password when prompted, and then check that the schema worked:
\connect swarm
\dt
First, make sure that you've authenticated with Heroku via the toolbelt:
$ heroku auth:login
You'll be prompted for your email and password; once finished, you'll be able to issue further commands to your instance.
Next, we make a backup of the current status of the database.
$ heroku pg:backups capture --app swarmcontrol
Then, download the backup:
$ curl -o latest.dump `heroku pg:backups public-url --app swarmcontrol`
Next, run the schema file on the database server (run this from the root of the installation):
$ cat database/schema.sql | heroku pg:sql --app swarmcontrol