-
Notifications
You must be signed in to change notification settings - Fork 37
Setting up a development Environment
You need to be comfortable with command-line tools and setting up environment variables.
- Install PostgreSQL, a Java 8 Development Kit and Git. Optionally, install LibreOffice.
git clone https://github.com/overview/overview-server.git
cd overview-server
./dev
That last command will take a long time -- maybe an hour as it downloads and compiles all required components. When the text stops, it's ready.
- Install PostgreSQL. For Mac users we recommend Postgres.app
- Install a Java Development Kit.
- Install Git.
- (optionally) Install LibreOffice.
- (On Linux) Install build tools:
build-essential
on Ubuntu,make
andgcc
on Fedora, etc. git clone https://github.com/overview/overview-server.git
Lost? Here's some guidance for the tricky bits:
Install PostgreSQL. Don't worry about starting, stopping, files or permissions: Overview handles that by running its own instance (on port 9010) in its own directory (overview-server/database/
).
- On Windows, we support EnterpriseDB if you install it in the default location.
- On Mac OS X, we recommend Postgres.app: install it, run it once, shut it down and you'll be done. We also support HomeBrew installation:
brew install postgres
. - On Debian/Ubuntu,
sudo apt-get install postgresql
. - On Fedora,
su -c "dnf install postgresql-server"
- On anything else, try the generic instructions. Overview will run if
initdb
andpostgres
are in yourPATH
.
You need to install a JDK to compile Overview's source code. It needs to be Java 8 or higher.
-
On Mac OS X and Windows, install from the Java SE download page. The "x64" versions are better for Overview; only install "x32" if you know "x64" won't work.
-
On Ubuntu:
sudo add-apt-repository ppa:openjdk-r/ppa sudo apt-get update sudo apt-get install openjdk-8-jdk
-
On Fedora,
su -c "dnf install java-1.8.0-openjdk-devel"
You can follow the directions at https://help.github.com/articles/set-up-git, which provide native apps for Mac OS X and Windows.
- On Ubuntu,
sudo apt-get install git
- On Fedora,
su -c "dnf install git-core"
- On Mac OS X or Windows, try the official install instructions or the GitHub install instructions -- whichever is easiest.
LibreOffice will help Overview parse several document formats, such as Microsoft Word .doc
and .docx
files.
- On Ubuntu,
sudo apt-get install libreoffice
- On Fedora,
sudo dnf install libreoffice
- On Mac OS X or Windows, download and install the official version.
- Find the location of the installed program called
soffice
- Set an environment variable
LIBRE_OFFICE_PATH
to the location ofsoffice
. For example:
- Find the location of the installed program called
export LIBRE_OFFICE_PATH=/Applications/LibreOffice.app/Contents/MacOS/soffice
Run this in a terminal from the overview-server
directory:
./dev
The first time you launch it, it will take a very long time: it will download all dependencies and compile all source code. Expect to wait 30 minutes on a reasonably fast computer with a decent Internet connection.
On Mac, you may be prompted to install XCode at some point. If you are, click "Install", wait for the install to finish, then run ./dev
again.
You'll be able to tell when it's done because you'll see text like this:
[overview-server] --- (Running the application from SBT, auto-reloading is enabled) ---
[overview-server]
[overview-server] [info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
[overview-server]
[overview-server] (Server started, use Ctrl+D to stop and go back to the console...)
Kill everything with Ctrl+C (or, as the message suggests, Ctrl+D).
You have three options:
- Use the default admin login. Email and password are
[email protected]
. - Register a new user from the main page. When you register, a confirmation "email" will be output on the console where you ran
./dev
. Follow the link in the "email" to complete your registration. - Or just run in single-user mode run
./dev -Doverview-server.props.overview.multi_user=false
. (This is the default when running downloadable binaries'./run
.)
Deprecation warning Prior to 2014-01-17, the email and password of the default admin login were [email protected]
(with a hyphen). If you never changed the default credentials, the upgrade will change them for you. If you did change the default credentials, the upgrade will have no effect.
When you're developing the workers, you probably won't want to keep them running all the time. So open one terminal and run this:
./dev --except-servers worker,documentset-worker
Then open a second terminal and run this:
./dev --only-servers worker,documentset-worker --no-database
Now you can run a compile-run-debug-edit cycle, by using Ctrl+C in the second terminal and leaving the first alone.
(The --no-database
flag is separate because the runner treats it separately: the database starts first and finishes last.)
To run just the database:
# start the server
postgres -D /full/path/to/overview-server/database -k /full/path/to/overview-server/database
# connect with the client
psql -U overview -p 9010 -h localhost overview-dev
The overview-server
component is special: if you edit files in app/
, they will be recompiled on the fly the next time you request a page. Read the Play documentation for more details.
Postgres must be running before tests can be run. Run ./dev
first or ./dev --database --except-servers search-index,message-broker,overview-server,documentset-worker,worker
if you only want the database up.
-
./sbt test
runs the server tests and sets up the test database (run this first, or try it if you get weird db errors running the other tests) -
./sbt all/test
runs all the tests (server, workers) -
./sbt {project}/test
runs the tests for subproject{project}
only.
You may test projects while they are running in other terminals. You may run into problems if you run unit tests at the same time as integration tests, as they use the same database.
If you plan on hacking JavaScript, follow the instructions in test/assets/javascripts/autotest/README.md
- Get the Scala IDE for eclipse at http://scala-ide.org. If you are running Eclipse 4.2 (Juno), make sure you get the correct version of the plugin: http://scala-ide.org/download/nightly.html#scala_ide_helium_nightly_for_eclipse_42_juno
- The Scala IDE Set Diagnostic tool may recommend increasing memory. See http://wiki.eclipse.org/FAQ_How_do_I_increase_the_heap_size_available_to_Eclipse for details. To edit eclipse.ini, right click on the Eclipse icon and select "Show Package Contents". Eclipse.ini is in the Contents/MacOS folder.
- Install the Scala IDE Play plugin http://scala-ide.org/docs/tutorials/play/index.html
- In a terminal, run
./sbt all/compile
- In a terminal,
play eclipse
- Start Eclipse
- Import
overview-server
as a project, along with the following sub-directories:- common
- worker-common
- documentset-worker
- worker