-
-
Notifications
You must be signed in to change notification settings - Fork 724
Development Environment Setup: Fedora
This guide will help you set up a development environment for OFN on Fedora.
sudo dnf install -y git-core git curl zlib-devel openssl-libs openssl-devel readline-devel libyaml-devel sqlite-devel sqlite libxml2-devel postgresql postgresql-server postgresql-contrib libpq-devel epel-release nodejs apg redis
sudo postgresql-setup --initdb --unit postgresql # if not already initialized
sudo systemctl start postgresql # launch PostgreSQL right now
sudo systemctl start redis # launch Redis right now
# Create database user "ofn". The default password in the codebase is "f00d".
# If you set something different, update the file `config/database.yml` accordingly
# sudo -u postgres psql -c "CREATE USER ofn WITH SUPERUSER CREATEDB PASSWORD 'f00d'"
sudo -u postgres createuser --superuser --pwprompt ofn # as an alternative
script/setup
# sudo postgresql-setup --upgrade # make sure that postgres schema are still compatible with the last version installed
sudo systemctl enable postgresql # always launch postgres at boot
sudo systemctl enable redis # always launch redis at boot
git config --global color.ui true
git config --global user.name "YOUR NAME"
git config --global user.email "YOUR@EMAIL.com"
Then you can follow the instructions from Ruby on Rails — Fedora Developer Portal
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
rbenv install 2.5.8
rbenv global 2.5.8
ruby -v
git clone https://github.com/nodenv/nodenv ~/.nodenv --depth 1
(cd ~/.nodenv && src/configure && make -C src)
# For Bash urers:
echo 'export PATH="$HOME/.nodenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(nodenv init -)"' >> ~/.bashrc
# for Fish users:
echo 'set PATH "$HOME/.nodenv/bin" $PATH' >> ~/.config/fish/config.fish
echo 'nodenv init - | eval' >> ~/.config/fish/config.fish
exec $SHELL -l # reload the shell
git clone https://github.com/nodenv/node-build.git "$HOME/.nodenv/plugins/node-build" --depth 1
nodenv install 5.12.0
If you don't ever use docs for gems, you can disable installation of documentation with:
echo "gem: --no-document" >> ~/.gemrc
Now we can install some supporting gems:
gem install bundler
# cd $SOME_PATH/openfoodnetwork
rake db:create
rake db:setup
Oct 2019: Newer installations of Ubuntu might come with Chromium installed via snap. As a result you may need to install Google Chrome and the Chrome Driver. If your tests run correctly without these steps, you may ignore them.
If you encounter an error such as Failure/Error: Capybara::Selenium::Driver .new(app, browser: :chrome, options: options) .tap { |driver| driver.browser.download_path = DownloadsHelper.path.to_s } NoMethodError: undefined method
strip' for nil:NilClass`, the following installation instructions should solve your issue:
TODO
- determine if Chromium could work equally well
- document consequently
TODO
- depending on previous section TODO, document the equivalent for Chromium, or how to deal with Chrome Driver on Fedora
wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
- Ruby on Rails — Fedora Developer Portal
- linux - Completely reset PostgreSQL to default? - Server Fault
- postgresql - pg_upgrade: "lc_collate values for database "postgres" do not match" - Stack Overflow
- Managing Node.js versions with anyenv & nodenv on macOS (for fish shell) | by Koji Mochizuki | TechNest | Medium
- Colombia configs by Matt-Yorkley · Pull Request #670 · openfoodfoundation/ofn-install
- Managing Node.js versions with anyenv & nodenv on macOS (for fish shell) | by Koji Mochizuki | TechNest | Medium
Development environment setup
- Pipeline development process
- Bug severity
- Feature template (epic)
- Internationalisation (i18n)
- Dependency updates
Development
- Developer Guidelines
- The process of review, test, merge and deploy
- Making a great commit
- Making a great pull request
- Code Conventions
- Database migrations
- Testing and Rspec Tips
- Automated Testing Gotchas
- Rubocop
- Angular and OFN
- Feature toggles
- Stimulus and Turbo
Testing
- Testing process
- OFN Testing Documentation (Handbooks)
- Continuous Integration
- Parallelized test suite with knapsack
- Karma
Releasing
Specific features
Data and APIs
Instance-specific configuration
External services
Design