-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathc9_install.sh
executable file
·25 lines (21 loc) · 1008 Bytes
/
c9_install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
# Use bundle to install the needed Ruby Gems
bundle install
# Install and start elasticsearch
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list
sudo apt update
sudo apt-add-repository ppa:webupd8team/java
sudo apt install apt-transport-https -y
sudo apt update
sudo apt-get install oracle-java8-installer -y
sudo apt-get update && sudo apt-get install elasticsearch
sudo update-rc.d elasticsearch defaults 95 10
sudo -i service elasticsearch start
sleep 10
# Migrate the database appropriately using rails and elasticsearch
rails db:environment:set RAILS_ENV=development
rails db:reset
rails searchkick:reindex:all