mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
[#40127] Update documentation to setup a dev environment
https://community.openproject.org/work_packages/40127
This commit is contained in:
@@ -5,16 +5,20 @@ To develop OpenProject a setup similar to that for using OpenProject in producti
|
||||
This guide assumes that you have a Ubuntu 20.04 installation with administrative rights. This guide will work
|
||||
analogous with all other distributions, but may require slight changes in the required packages. _Please, help us to extend this guide with information on other distributions should there be required changes._
|
||||
|
||||
OpenProject will be installed with a PostgreSQL database.
|
||||
OpenProject Development Environment will be installed with a PostgreSQL database, OpenProject on-premises installation shall NOT be present before.
|
||||
|
||||
**Please note**: This guide is NOT suitable for a production setup, but only for developing with it!
|
||||
|
||||
Remark: *At the time of writing* in this page refers to 12/10/2021
|
||||
|
||||
If you find any bugs or you have any recommendations for improving this tutorial, please, feel free to send a pull request or comment in the [OpenProject forums](https://community.openproject.org/projects/openproject/boards).
|
||||
|
||||
# Prepare your environment
|
||||
|
||||
We need an active Ruby and Node JS environment to run OpenProject. To this end, we need some packages installed on the system.o
|
||||
|
||||
CPU recommendation: 4 VCPUs (2 VCPU minimum), Memory recommendation: 8 better 16 GB (4 GB minimum)
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo apt-get install git curl build-essential zlib1g-dev libyaml-dev libssl-dev libpq-dev libreadline-dev
|
||||
@@ -22,7 +26,7 @@ sudo apt-get install git curl build-essential zlib1g-dev libyaml-dev libssl-dev
|
||||
|
||||
## Install Ruby
|
||||
|
||||
Use [rbenv](https://github.com/rbenv/rbenv) and [ruby-build](https://github.com/rbenv/ruby-build#readme) to install Ruby. We always require the latest ruby versions, and you can check which version is required by [checking the Gemfile](https://github.com/opf/openproject/blob/dev/Gemfile#L31) for the `ruby "~> X.Y"` statement. At the time of writing, this version is "2.7"
|
||||
Use [rbenv](https://github.com/rbenv/rbenv) and [ruby-build](https://github.com/rbenv/ruby-build#readme) to install Ruby. We always require the latest ruby versions, and you can check which version is required by [checking the Gemfile](https://github.com/opf/openproject/blob/dev/Gemfile#L31) for the `ruby "~> X.Y"` statement. At the time of writing, this version is "2.7.5"
|
||||
|
||||
### Install rbenv and ruby-build
|
||||
|
||||
@@ -39,6 +43,8 @@ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
|
||||
|
||||
# Run rbenv-init and follow the instructions to initialize rbenv on any shell
|
||||
~/.rbenv/bin/rbenv init
|
||||
# Issue the recommended command from the stdout of the last command
|
||||
echo 'eval "$(rbenv init - bash)"' >> ~/.bashrc
|
||||
# Source bashrc
|
||||
source ~/.bashrc
|
||||
```
|
||||
@@ -71,11 +77,7 @@ rbenv global 2.7.5
|
||||
rbenv rehash
|
||||
```
|
||||
|
||||
You also need to install [bundler](https://github.com/bundler/bundler/), the ruby gem bundler.
|
||||
|
||||
```bash
|
||||
gem install bundler
|
||||
```
|
||||
You also need to install [bundler](https://github.com/bundler/bundler/), the ruby gem bundler (remark: if you run into an error, first try with a fresh reboot).
|
||||
|
||||
If you get `Command 'gem' not found...` here, ensure you followed the instructions `rbenv init` command to ensure it is loaded in your shell.
|
||||
|
||||
@@ -121,6 +123,8 @@ echo 'export PATH="$HOME/.nodenv/bin:$PATH"' >> ~/.bashrc
|
||||
|
||||
# Run nodenv init and follow the instructions to initialize nodenv on any shell
|
||||
~/.nodenv/bin/nodenv init
|
||||
# Issue the recommended command from the stdout of the last command
|
||||
echo 'eval "$(nodenv init -)"' >> ~/.bashrc
|
||||
# Source bashrc
|
||||
source ~/.bashrc
|
||||
```
|
||||
@@ -135,11 +139,11 @@ git clone https://github.com/nodenv/node-build.git $(nodenv root)/plugins/node-b
|
||||
|
||||
You can find the latest LTS version here: https://nodejs.org/en/download/
|
||||
|
||||
At the time of writing this is v14.17.0 Install and activate it with:
|
||||
At the time of writing this is v16.13.1 Install and activate it with:
|
||||
|
||||
```bash
|
||||
nodenv install 14.17.0
|
||||
nodenv global 14.17.0
|
||||
nodenv install 16.13.1
|
||||
nodenv global 16.13.1
|
||||
nodenv rehash
|
||||
```
|
||||
|
||||
@@ -155,19 +159,19 @@ You should now have an active ruby and node installation. Verify that it works w
|
||||
|
||||
```bash
|
||||
ruby --version
|
||||
ruby 2.7.5p203 (2021-07-07 revision a21a3b7d23) [x86_64-linux]
|
||||
ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux]
|
||||
|
||||
bundler --version
|
||||
Bundler version 2.1.4
|
||||
Bundler version 2.2.33
|
||||
|
||||
node --version
|
||||
v14.16.1
|
||||
v16.13.1
|
||||
|
||||
npm --version
|
||||
7.15.1
|
||||
8.3.0
|
||||
```
|
||||
|
||||
# Install OpenProject
|
||||
# Install OpenProject Sources
|
||||
|
||||
In order to create a pull request to the core OpenProject repository, you will want to fork it to your own GitHub account.
|
||||
This allows you to create branches and push changes and finally opening a pull request for us to review.
|
||||
@@ -177,6 +181,8 @@ To do that, go to https://github.com/opf/openproject and press "Fork" on the upp
|
||||
```bash
|
||||
# Download the repository
|
||||
# If you want to create a pull request, replace the URL with your own fork as described above
|
||||
mkdir ~/dev
|
||||
cd ~/dev
|
||||
git clone https://github.com/opf/openproject.git
|
||||
cd openproject
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user