-
Notifications
You must be signed in to change notification settings - Fork 3
1. Installation
You can use docker to just run the project.
You must define the environment variable GITHUB_TOKEN with a valid github token to be able to download the private gems if any.
If you don't have one, you can remove the respective lines in the docker-compose.yml file: :?GITHUB_TOKEN is required in args of base elvis image.
Download the source code and run the commands below:
docker-compose builddocker-compose up
For the initial setup, create the first super user using the command below:
docker exec -it elvis bashrails console-
u = User.new email: "johndoe@gmail.com", is_admin: true, is_creator: true, first_name: "John", last_name: "Doe", current_sign_in_at: DateTime.now, last_sign_in_at: DateTime.now, sign_in_count: 1 u.password = "test1234" u.password_confirmation = "test1234" u.save!
You can now access the application on http://localhost:7212
You can also use docker directly to run the project.
In this case, you must run a postgresql server and set all environment variables like in the docker-compose.yml file. The same applies to elastic-search.
-
docker build --build-arg github_token -t elvis . -
For database setup, you have two options:
- use docker run with init entrypoint
docker run -p 7212:7212 -e ... --entrypoint "./entrypoints/init.sh" elvis
- run the commands below (in elvis container or directly in your terminal - requires local install of rails):
-
bundle exec rake elvis:plugins:discover bundle exec rake elvis:plugins:migrate
-
- use docker run with init entrypoint
docker run -p 7212:7212 -e ... elvis
You can also use the image provided on this github repository, but this image does not contain any plugins.
To use this image, replace elvis:build image tag by ghcr.io/elvis-software/elvis:latest in the docker-compose.yml file and remove build section or in the docker run command.
You can use the script ubuntu22.sh to install all dependencies and compile the project (you must run script at the root of the project).
chmod u+x ./dev-install/ubuntu22.sh./dev-install/ubuntu22.sh [psql_password] [rails admin email] [rails admin first name] [rails admin last name] [rails admin password]
All parameters in [] are optional, if you don't specify them, default values will be used.
- install rvm
- Install dependencies and rvm
sudo apt-get install software-properties-common sudo apt-add-repository -y ppa:rael-gc/rvm sudo apt-get update sudo apt-get install rvm libssl1.0-dev
- optionnaly add your user to the rvm group to avoid using sudo
sudo usermod -a -G rvm $USER
- Install dependencies and rvm
- install ruby version 3.0.2
-
rvm install 3.0.2
-
- install bundler (bundle version is specified in the
Gemfile.lockfile) :gem install bundler
- install postgresql version 14 or postgresql-client version 14
-
sudo apt-get install postgresql-14
-
sudo apt-get install libpq-dev postgresql-client-14
-
- install node version 14
- direct install
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - sudo apt-get install -y nodejs - install with nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" && \. "$NVM_DIR/nvm.sh" source $NVM_DIR/nvm.sh nvm install 14
- direct install
- install yarn in global
npm install --global yarn
- you can now install optional dependencies
- go to compile section
- Local redis server
docker pull redis:6.2.6docker run -p 127.0.0.1:6379:6379 redis
- Local elastic-search server
docker pull elasticsearch:7.16.3docker run -p 127.0.0.1:9200:9200 -p 127.0.0.1:9300:9300 -e "discovery.type=single-node" elasticsearch:7.16.3
at the root of the repository :
bundle installyarn
- first run
rails db:prepare
- if you use an existing database
rails db:migrate
- if plugins are added, complete plugin doc before run
- run a rails console to create an admin user:
rails console
u = User.new email: "johndoe@gmail.com", is_admin: true, first_name: "John", last_name: "Doe", current_sign_in_at: DateTime.now, last_sign_in_at: DateTime.now, sign_in_count: 1
u.password = "test1234"
u.password_confirmation = "test1234"
u.save!foreman start