- You need an
.env
file, duplicate.env.example
and edit to fit your environment - Run below command to create db
bundle exec rake db:create
- Run below command to apply migrations
bundle exec rake ridge:apply ALLOW_DROP_TABLE=1 ALLOW_REMOVE_COLUMN=1
-
Obtains your google API key for more infos fetchable from youtube. If
YOUTUBE_API_KEY
doesnt provided, you can still fetch from youtube but will not able to fetch data likedescription
norpublisedAt
How to get your google API key: https://console.developers.google.com/
-
Actually we can make an service to crawl data from youtube using
capybara
but will take more time and the process will not be fast, not a good idea though
- You need an
.env.test.local
file, duplicate.env.test.local.example
and edit to fit your test environment - Create test database
bundle exec rake db:create RAILS_ENV=test
- Apply migrations for test database
bundle exec rake ridge:apply ALLOW_DROP_TABLE=1 ALLOW_REMOVE_COLUMN=1 RAILS_ENV=test
- Rspec command
bundle exec rspec -fd
You'll need superuser access to run these commands successfully Start by updating and upgrading our current packages:
sudo apt update && sudo apt full-upgrade
Install the prerequisite packages:
sudo apt install curl git bridge-utils
Install Docker CE:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
Install Docker-Compose:
sudo curl -s https://api.github.com/repos/docker/compose/releases/latest | grep "browser_download_url" | grep -m1 `uname -s`-`uname -m` | cut -d '"' -f4 | xargs sudo curl -L -o /usr/local/bin/docker-compose
Set the permissions: sudo chmod +x /usr/local/bin/docker-compose
Verify the Docker Compose installation: docker-compose -v
Add the current user to the docker group:
sudo usermod -aG docker $USER
Reboot your machine manually, or using the command line:
sudo reboot
- Use SSH to connect to a remote server
- You need an
.env
file, duplicate.env.production.example
and edit to fit your environment - Obtains google API key same way at development environment
- Put
production.key
key atconfig\credentials
- Run below command to build docker image
docker-compose build
- Start docker container in the background
docker-compose up -d
- Finally, you need to create the database. In another terminal, run
docker-compose run web bundle exec rake db:create
docker-compose run web bundle exec rake ridge:apply ALLOW_DROP_TABLE=1 ALLOW_REMOVE_COLUMN=1
docker-compose run web bundle exec rake db:seed