-
Notifications
You must be signed in to change notification settings - Fork 4
Setting up the development environment
The following repositories are needed:
- ontohub-backend
- ontohub-frontend
- ontohub-models
- ontohub-git-shell
- hets-agent
- gitlab_git
- graphql-pundit
-
macOS only: Install Homebrew according to the "Install Homebrew" section at http://brew.sh.
-
Debian only: Install development libraries:
sudo apt-get install cmake libicu-dev -
Install Ruby:
- Install chruby according to the chruby homepage. This allows you to have several independent ruby versions installed in your home directory.
- Install ruby-install according to the ruby-install homepage. This allows you to build ruby versions with chruby.
- Install ruby by running
ruby-install "ruby-$(cat .ruby-version)"in the directory of a ruby-based project (e.g. in ontohub-backend). - Install bundler:
gem install bundler. - Install rubocop linter:
gem install rubocop. - Optional: Install httpie to get more beatuiful JSON output when making HTTP requests from the console. Read their Readme file.
-
Install frontend dependencies (Javascript):
- Install Yarn package manager
- Now would be the time, if you want to change yarn's global install directory.
- Install ESLint linter:
yarn global add eslint.
-
Install PostgreSQL and create the databases:
- Installation
-
macOS:
Run
brew install postgresqlto install it. Then, runbrew services start postgresqlto start it with every boot. You can disable starting it with every boot withbrew services stop postgresql. -
Arch Linux:
sudo pacman -Sy postgresql. To put it in autostart, runsudo systemctl enable postgresql. To remove it from autostart, runsudo systemctl disable postgresql. -
Ubuntu Linux:
sudo apt-get install postgresql libpq-dev.
-
macOS:
Run
-
Debian only: Loosen the super user restrictions such that any user may connect to the database server as the super user: Let the following lines be the only uncommented lines in the
/etc/postgresql/X.Y/main/pg_hba.confThe first line is the most important line. We have changedlocal all all trust host all all 127.0.0.1/32 trust host all all ::1/128 trustpeertotrust. - Initialize the database directory with
initdb /usr/local/var/postgres -E utf8. - Create the database user that is used by Ontohub with
createuser -d -w -s postgres. - Create the development database by running
rails db:create && rails db:migratein the ontohub-backend project directory. This database is shared among the different projects. - Create the test databases by running
RAILS_ENV=test rails db:create && RAILS_ENV=test rails db:migratein each directory of the projects
- Installation
-
Install RabbitMQ and plugins:
- RabbitMQ
-
macOS only:
Run
brew install rabbitmq. To start rabbitmq with every boot, runbrew services start rabbitmq. To disable autostart, runbrew services stop rabbitmq. If you want to run in manually in the foreground, runrabbitmq-server. -
Arch Linux:
sudo pacman -Sy rabbitmq. To put it in autostart, runsudo systemctl enable rabbitmq. To remove it from autostart, runsudo systemctl disable rabbitmq. -
Ubuntu Linux:
sudo apt-get install rabbitmq-server
-
macOS only:
Run
- Enable the plugin
rabbitmq_recent_history_exchange:-
macOS:
/usr/local/opt/rabbitmq/sbin/rabbitmq-plugins enable rabbitmq_recent_history_exchange -
other systems:
rabbitmq-plugins enable rabbitmq_recent_history_exchange
-
macOS:
- RabbitMQ
-
Install phantomjs. This is used for the frontend tests.
-
macOS:
brew install phantomjs. -
Arch Linux:
sudo pacman -Sy phantomjs. -
Ubuntu Linux:
sudo apt-get install phantomjs.
-
macOS:
-
Install Elasticsearch:
-
macOS:
brew install elasticsearch. To put it in autostart, runbrew services start elasticsearch. To remove it from autostart, runbrew services stop elasticsearch. -
Arch Linux:
sudo pacman -Sy elasticsearch. To put it in autostart, runsudo systemctl enable elasticsearch. To remove it from autostart, runsudo systemctl disable elasticsearch. - Ubuntu Linux: Install from APT repository as described on the Elasticsearch installation page.
-
macOS:
-
Install Hets:
-
macOS: First, obtain the package repository with
brew tap spechub/hetsand then, install Hets withbrew install hets-desktop(with GUI) orbrew install hets-server(without GUI). -
Arch Linux: Install
hets-desktop(with GUI) orhets-server(without GUI) from the AUR. -
Ubuntu Linux: Run
sudo apt-get install hets-desktop(with GUI) orsudo apt-get install hets-server(without GUI).
-
macOS: First, obtain the package repository with
To use the local repository of our gems, run the following command:
bundle config --local local.ontohub-models <absolute path to the ontohub-models repository>
bundle config --local local.gitlab_git <absolute path to the gitlab_git repository>
bundle config --local local.graphql-pundit <absolute path to the graphql-pundit repository>In each repository (except ontohub-frontend), starting with ontohub-models, run the following command to install all the dependencies:
bundle installBy default, yarn uses the same directories, that npm uses. This usually means that root is required to install new packages. You can change the install path to e.g. ~/.npm-packages by running the following commands:
mkdir "$HOME/.npm-packages"
echo 'NPM_PACKAGES="$HOME/.npm-packages"\nPATH="$PATH:$NPM_PACKAGES/bin"' >> ~/.bashrc # or ~/.zshrc
echo 'prefix=${HOME}/.npm-packages' >> ~/.npmrcRun the following commands in the frontend repository:
Restart your shell and run the following commands in the frontend repository directory:
yarn --pure-lockfile # install build dependencies
yarn run bower install # install runtime dependenciesTo start the frontend, run yarn start.