-
Notifications
You must be signed in to change notification settings - Fork 235
Build Guide
This document is a step-by-step guide to build Cortex from sources.
The following softwares are required to download and build Cortex.
- Java Development Kit 8 (JDK)
- downloadable from http://www.oracle.com/technetwork/java/javase/downloads/index.html
- git
- Use the system package or downloadable it from http://www.git-scm.com/downloads
- NodeJs with its package manager (NPM)
- downloadable from https://nodejs.org/en/download/
- Grunt
- After NodeJs installation, run
sudo npm install -g grunt-cli
- After NodeJs installation, run
- Bower
- After NodeJs installation, run
sudo npm install -g bower
- After NodeJs installation, run
To install the requirements and build Cortex from sources, please follow the instructions below depending on your operating system.
sudo yum -y install git bzip2
sudo yum -y install java-1.8.0-openjdk-devel
Install the EPEL Repository:
sudo yum -y install https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
Then, you can install NodeJs:
sudo yum -y install nodejs
sudo npm install -g bower grunt-cli
sudo apt-get install git wget
sudo echo 'deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main' | sudo tee -a /etc/apt/sources.list.d/java.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key EEA14886
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install wget
wget -qO- https://deb.nodesource.com/setup_4.x | bash -
sudo apt-get install nodejs
sudo npm install -g bower grunt-cli
git clone https://github.com/CERT-BDF/Cortex.git
cd Cortex
bin/activator clean stage
It will download all dependencies (could be long) then build the back-end.
This command clean previous build files and create an autonomous package in target/universal/stage
directory. This packages contains Cortex binaries with required libraries (/lib
), configuration files (/conf
) and startup scripts (/bin
).
Binaries are built and stored in Cortex/target/universal/stage/
. Install them in /opt/cortex
for example.
sudo cp -r Cortex/target/universal/stage /opt/cortex
Follow the configuration part of the installation guide to run Cortex.
Go to front-end directory:
cd Cortex/ui
Install NodeJs libraries (required by building step), bower libraries (javascript libraries downloaded by browser). Then build the front-end :
npm install
bower install
grunt build
This step generates static files (html, javascript and related resources) in dist
directory. These files are ready to be imported in http server.