Akron | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 1 | # -*- mode: ruby -*- |
| 2 | # vi: set ft=ruby : |
| 3 | |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame] | 4 | # The "2" in Vagrant.configure configures the configuration version. |
| 5 | # Please don't change it unless you know what you're doing. |
Akron | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 6 | Vagrant.configure(2) do |config| |
Akron | cc10f9a | 2018-10-09 19:57:27 +0200 | [diff] [blame^] | 7 | |
Akron | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 8 | # https://docs.vagrantup.com. |
| 9 | |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame] | 10 | # More at https://vagrantcloud.com/search. |
| 11 | config.vm.box = "ubuntu/trusty64" |
Akron | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 12 | |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame] | 13 | config.vm.provider "virtualbox" do |vb| |
| 14 | vb.customize ["modifyvm", :id, "--memory", "1024"] |
| 15 | end |
| 16 | |
| 17 | config.vm.box_download_insecure = true |
| 18 | |
| 19 | # Provisioning of KorAP with a Shell script |
| 20 | config.vm.provision "shell", privileged: false, inline: <<-SHELL |
Akron | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 21 | |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame] | 22 | ############################################### |
| 23 | echo "Install Packages" |
Akron | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 24 | |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame] | 25 | # Add repository for OpenJDK |
| 26 | sudo add-apt-repository ppa:openjdk-r/ppa |
Akron | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 27 | |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame] | 28 | sudo apt-get update |
Akron | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 29 | |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame] | 30 | echo "Install dependencies" |
| 31 | sudo apt-get install -qq git |
| 32 | sudo apt-get install -qq openjdk-8-jdk |
| 33 | sudo apt-get install -qq perlbrew |
| 34 | sudo apt-get install -qq emacs |
| 35 | sudo apt-get install -qq maven |
Akron | cc10f9a | 2018-10-09 19:57:27 +0200 | [diff] [blame^] | 36 | sudo apt-get install -qq nodejs |
| 37 | sudo apt-get install -qq npm |
| 38 | sudo apt-get install -qq ruby |
Akron | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 39 | |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame] | 40 | # Workaround for https://bugs.launchpad.net/ubuntu/+source/ca-certificates-java/+bug/1396760 |
| 41 | sudo /var/lib/dpkg/info/ca-certificates-java.postinst configure |
Akron | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 42 | |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame] | 43 | ############################################### |
| 44 | echo "Install Koral" |
| 45 | cd ~/ |
| 46 | if [ -e ./Koral ] && [ -d ./Koral ] |
| 47 | then |
| 48 | cd Koral |
| 49 | git pull origin master |
| 50 | else |
| 51 | git clone https://github.com/KorAP/Koral.git Koral |
| 52 | cd Koral |
| 53 | fi |
| 54 | mvn clean install -Dhttps.protocols=TLSv1.2 |
| 55 | |
| 56 | |
| 57 | ############################################### |
| 58 | echo "Install Krill" |
| 59 | cd ~/ |
| 60 | if [ -e ./Krill ] && [ -d ./Krill ] |
| 61 | then |
| 62 | cd Krill |
| 63 | git pull origin master |
| 64 | else |
| 65 | git clone https://github.com/KorAP/Krill.git Krill |
| 66 | cd Krill |
| 67 | fi |
| 68 | mvn clean install |
| 69 | |
| 70 | |
| 71 | ############################################### |
| 72 | echo "Install Kustvakt" |
| 73 | cd ~/ |
| 74 | if [ -e ./Kustvakt ] && [ -d ./Kustvakt ] |
| 75 | then |
| 76 | cd Kustvakt |
| 77 | git pull origin master |
| 78 | else |
| 79 | git clone https://github.com/KorAP/Kustvakt.git Kustvakt |
| 80 | cd Kustvakt |
| 81 | fi |
| 82 | |
| 83 | cd ~/Kustvakt/core |
| 84 | mvn clean install |
| 85 | |
| 86 | cd ~/Kustvakt/lite |
| 87 | mvn clean package |
| 88 | |
| 89 | |
| 90 | ############################################### |
Akron | cc10f9a | 2018-10-09 19:57:27 +0200 | [diff] [blame^] | 91 | echo "Install NodeJS" |
| 92 | # This is required unfortunately |
| 93 | mkdir ~/tmp |
| 94 | npm set ca null |
| 95 | # sudo npm install -g n |
| 96 | # sudo n stable |
| 97 | sudo npm install -g sass |
| 98 | sudo npm install -g grunt-cli |
| 99 | sudo npm install grunt |
| 100 | |
| 101 | |
| 102 | ############################################### |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame] | 103 | echo "Install Perlbrew + CPANminus" |
| 104 | cd ~/ |
| 105 | |
| 106 | perlbrew init |
| 107 | echo "source ~/perl5/perlbrew/etc/bashrc" >> ~/.bashrc |
| 108 | |
| 109 | source ~/perl5/perlbrew/etc/bashrc |
| 110 | |
| 111 | perlbrew self-upgrade |
| 112 | perlbrew install -q perl-5.24.0 |
| 113 | |
| 114 | perlbrew switch perl-5.24.0 |
| 115 | perlbrew install-cpanm |
| 116 | |
| 117 | |
| 118 | ############################################### |
| 119 | echo "Install Kalamar server-side dependencies" |
| 120 | cpanm git://github.com/Akron/Mojolicious-Plugin-Search.git |
| 121 | cpanm git://github.com/Akron/Mojolicious-Plugin-Localize.git |
| 122 | cpanm git://github.com/Akron/Mojolicious-Plugin-TagHelpers-ContentBlock.git |
| 123 | |
| 124 | |
| 125 | ############################################### |
| 126 | echo "Install Kalamar" |
Akron | cc10f9a | 2018-10-09 19:57:27 +0200 | [diff] [blame^] | 127 | cd ~/ |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame] | 128 | if [ -e ./Kalamar ] && [ -d ./Kalamar ] |
| 129 | then |
| 130 | cd Kalamar |
| 131 | git pull origin master |
| 132 | else |
| 133 | git clone git://github.com/KorAP/Kalamar.git Kalamar |
| 134 | cd Kalamar |
| 135 | fi |
| 136 | |
| 137 | cpanm --installdeps . |
| 138 | |
| 139 | ############################################### |
| 140 | # echo "Install Kalamar client-side dependencies" |
Akron | cc10f9a | 2018-10-09 19:57:27 +0200 | [diff] [blame^] | 141 | npm install |
| 142 | grunt |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame] | 143 | |
| 144 | SHELL |
Akron | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 145 | end |