Skip to content

Setting up a Development Environment (on Ubuntu, Kali, Debian)

Jonathan Cran edited this page Sep 24, 2020 · 14 revisions

Assumptions

You have installed an apt-based Linux environment, such as Ubuntu, Debian, or Kali (either as a base system or as a VM). You have created a GitHub account and associated an ssh key with it. You have familiarity with Git and Github, or have completed the Github bootcamp.

Before you get started..

  • Get access to the system's CLI
  • Make sure you have enough memory (16GB+ is recommended)

To check your system, run the following command : top -l 1 -s 0 | grep PhysMem

Fork the repository

In order to get started, you'll want to create your own fork.

Pulling down a local copy

Pull down the repository to your local machine with:

mkdir core
git clone [email protected]:YOUR-FORK/intrigue-core.git core

Install dependencies

Execute the script to install all dependencies (both system level and ruby dependencies will be installed). Note that this script is actively tested on ubuntu 18.04 and all other versions / variants may need slight adjustments.

cd core
./util/bootstrap.sh 

If you encounter an error with the above command, please make a copy of the error message and open a new issue to let us know what happened.

If everything went well, you'll now have a install with ruby and all the gem dependencies (managed by Bundler).

Create Config Files & Migrate the DB

You'll need to run a couple tasks to copy the (.default) config files to the correct places and to migrate the database to the latest revision. Do that by running the below commands in the directory / root of the intrigue-core repository:

bundle exec rake setup # Copies config files to the right places
bundle exec rake db:migrate # migrates the DB to the latest

Configure your local fork (to make pull requests)

In order to work on the latest bits, you'll want to base on the upstream develop branch. 'Develop' is our unstable branch and is where most of the new functionality is developed and tested ahead of a release. To configure your local setup, do the following:

git checkout develop # create and checkout a local develop branch - develop is our 'unstable'
git push -u # set git to track your develop

Creating your first task

You'll want to work on all changes in a separate branch, so go ahead and make a new branch with the following command:

git branch YOUR-BRANCH-NAME
git checkout YOUR-BRANCH-NAME

Clone the 'example' task and make your changes and commit them. Commit messages should follow 50/72 guidelines. If any api keys are used, make sure they're added to to the config/config.json.default file.

git status (To see what you're doing)
git commit -m "Use a descriptive message here, following the 50/72 guidelines (https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)

Submitting a pull request

Okay, so now you're ready to push your changes upstream! In order to do so, you'll be creating a pull request. For background on pull requests: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests - Creating one is pretty simple:

First, commit your branch, then browse to view the commit in github: https://github.com/YOUR-FORK/intrigue-core/branches

Then create a pull request using the "New Pull Request" button: creating a pull request

Please submit pull requests against our unstable 'develop' branch. This ensures new functionality is well tested ahead of release.

Questions

Email [email protected] and ask to join the slack channel if you have any trouble at all!