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 | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 7 | # https://docs.vagrantup.com. |
| 8 | |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame^] | 9 | # More at https://vagrantcloud.com/search. |
| 10 | config.vm.box = "ubuntu/trusty64" |
Akron | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 11 | |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame^] | 12 | config.vm.provider "virtualbox" do |vb| |
| 13 | vb.customize ["modifyvm", :id, "--memory", "1024"] |
| 14 | end |
| 15 | |
| 16 | config.vm.box_download_insecure = true |
| 17 | |
| 18 | # Provisioning of KorAP with a Shell script |
| 19 | config.vm.provision "shell", privileged: false, inline: <<-SHELL |
Akron | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 20 | |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame^] | 21 | ############################################### |
| 22 | echo "Install Packages" |
Akron | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 23 | |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame^] | 24 | # Add repository for OpenJDK |
| 25 | sudo add-apt-repository ppa:openjdk-r/ppa |
Akron | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 26 | |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame^] | 27 | sudo apt-get update |
Akron | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 28 | |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame^] | 29 | echo "Install dependencies" |
| 30 | sudo apt-get install -qq git |
| 31 | sudo apt-get install -qq openjdk-8-jdk |
| 32 | sudo apt-get install -qq perlbrew |
| 33 | sudo apt-get install -qq emacs |
| 34 | sudo apt-get install -qq maven |
| 35 | # sudo apt-get install -qq nodejs |
| 36 | # sudo apt-get install -qq npm |
| 37 | # sudo apt-get install -qq ruby |
Akron | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 38 | |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame^] | 39 | # Workaround for https://bugs.launchpad.net/ubuntu/+source/ca-certificates-java/+bug/1396760 |
| 40 | sudo /var/lib/dpkg/info/ca-certificates-java.postinst configure |
Akron | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 41 | |
Akron | a7b661d | 2018-10-09 19:13:45 +0200 | [diff] [blame^] | 42 | |
| 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 | ############################################### |
| 91 | echo "Install Perlbrew + CPANminus" |
| 92 | cd ~/ |
| 93 | |
| 94 | perlbrew init |
| 95 | echo "source ~/perl5/perlbrew/etc/bashrc" >> ~/.bashrc |
| 96 | |
| 97 | source ~/perl5/perlbrew/etc/bashrc |
| 98 | |
| 99 | perlbrew self-upgrade |
| 100 | perlbrew install -q perl-5.24.0 |
| 101 | |
| 102 | perlbrew switch perl-5.24.0 |
| 103 | perlbrew install-cpanm |
| 104 | |
| 105 | |
| 106 | ############################################### |
| 107 | echo "Install Kalamar server-side dependencies" |
| 108 | cpanm git://github.com/Akron/Mojolicious-Plugin-Search.git |
| 109 | cpanm git://github.com/Akron/Mojolicious-Plugin-Localize.git |
| 110 | cpanm git://github.com/Akron/Mojolicious-Plugin-TagHelpers-ContentBlock.git |
| 111 | |
| 112 | |
| 113 | ############################################### |
| 114 | echo "Install Kalamar" |
| 115 | |
| 116 | if [ -e ./Kalamar ] && [ -d ./Kalamar ] |
| 117 | then |
| 118 | cd Kalamar |
| 119 | git pull origin master |
| 120 | else |
| 121 | git clone git://github.com/KorAP/Kalamar.git Kalamar |
| 122 | cd Kalamar |
| 123 | fi |
| 124 | |
| 125 | cpanm --installdeps . |
| 126 | |
| 127 | ############################################### |
| 128 | # echo "Install Kalamar client-side dependencies" |
| 129 | # sudo gem install sass |
| 130 | |
| 131 | SHELL |
Akron | 228cfa1 | 2018-10-01 16:14:41 +0200 | [diff] [blame] | 132 | end |