$ sudo apt install git
Development Environment Installation with Docker
This document describes the development environment installation for frontend and backend developers
-
Install Docker. Docker Compose
-
Install Git and configure SSH Key for Github
-
Clone a Springboard and run it
Note
|
Code Editor software is up to developer’s choice |
Basic Installation
1. Install Docker and Docker Compose
-
Install Docker by following the reference documentation : https://docs.docker.com/install/linux/docker-ce/ubuntu/#set-up-the-repository
-
Grant non-root user to run Docker : https://docs.docker.com/install/linux/linux-postinstall/
-
Install Docker Compose by following the reference documentation : https://docs.docker.com/compose/install/#install-using-pip
Warning
|
Step 2 is mandatory |
Note
|
Installation’s documentation for others OS is available here : https://docs.docker.com/install/ |
2. Install Git and configure SSH Key for Github
Install Git:
To set SSH key for Github, please follow the reference documentations below:
Clone a Springboard and run it
Get the Springboard’s boilerplate repository:
$ git clone [email protected]:entcore/springboard.git $ cd springboard
Run it
./build.sh clean init generateConf run
Available commands for build.sh script are:
clean : clean springboard and docker's containers init : fetch files and artefacts useful for springboard's execution generateConf : generate an vertx configuration file (ent-core.json) from conf.properties run : run databases and vertx in distinct containers stop : stop containers integrationTest : run integration tests buildFront : fetch widgets and themes using Bower and run Gulp build. (/!\ first run can be long because of node-sass's rebuild). archive : make an archive with folder /mods /assets /static publish : upload the archive on nexus
For Backend Development
Install JDK 8
Installation:
$ sudo add-apt-repository ppa:webupd8team/java $ sudo apt-get update $ sudo apt-get install oracle-java8-installer
Check installation:
$ java -version java version "1.8.0_152" Java(TM) SE Runtime Environment (build 1.8.0_152-b16) Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
Install Gradle 4.5
Installation:
$ cd ~/apps $ wget https://services.gradle.org/distributions/gradle-4.5-bin.zip $ unzip gradle-4.5-bin.zip $ ln -s gradle-4.5 gradle $ rm gradle-4.5-bin.zip
Add binary to Path:
$ echo PATH=\"\$HOME/apps/gradle/bin:\$PATH\" >> ~/.profile $ . ~/.profile
Check version:
$ gradle -v
Install your favorite Java IDE
Monitor the containers
Docker Compose names container with COMPOSE_PROJECT_NAME convention. In our context container’s name are prepended with Springboard’s directory name (${SPRINGBOARD_DIR}).
You can run the below command to monitor your container’s activity
-
List running’s containers :
docker ps`
-
List all containers :
docker ps -a
-
Open Neo4j’s shell :
docker exec -it ${SPRINGBOARD_DIR}_neo4j_1 bin/neo4j-shell
-
Open PostgrSQL’s shell :
docker exec -it ${SPRINGBOARD_DIR}_postgres_1 psql -U web-education ong
-
Open MongoDB’s shell :
docker exec -it ${SPRINGBOARD_DIR}_mongo_1 mongo one_gridfs
-
Open a Bash’s shell on vertx’s container :
docker exec -it ${SPRINGBOARD_DIR}_vertx_1 bash
-
Display Vertx’s logs :
docker logs -f ${SPRINGBOARD_DIR}_vertx_1
-
Display all containers logs :
docker-compose logs -f
Change Vertx log level
Map local directories to container’s volume
use your maven local
Uncomment
# - ~/.m2:/home/vertx/.m2
Use your local data
Use Neo4j console
Add the next port’s mapping in neo4j container’s description
ports: - "7474:7474" - "7687:7687"
Enable Bolt Protocol in neo4j-conf/neo4j.conf
dbms.connector.bolt.enabled=true
Neo4j’s Console is accessible via http://localhost:7474/browser
Enable Remote Debugging
As vertx services are running inside a docker container, it is not possible to enable local debugging. So we will use remote debugging to bypass this issue.
First, make sure you have exposed the remote agent port from the vertx docker container.
To do so, open your springboard directory and edit the file "docker-compose.yml". It should contains the following port configuration:
vertx: image: opendigitaleducation/vertx-service-launcher:1.0.0 user: "1000:1000" ports: - "8090:8090" - "5000:5000"
Then, restart your docker container using:
./build.sh stop init
Note
|
Behind the scene, remote debugging is enabled in vertx-service-launcher using this JVM property:
This JVM option start an agent listening on port 5000 and letting your IDE debugging the application. |
Your vertx container is now ready. Let’s configure your IDE.
To configure your IDE, create a new debug configuration and set followings properties:
-
Host = localhost (or any IP address allowing to reach the vertx container)
-
Port = 5000
-
Connection Type = Socket Attach
Warning
|
If you are using Eclipse you must select all source folders you would like to debug |
You can now use your configuration to start a remote debug session.