forked from eMoflon/emoflon-ibex-vm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prov.sh
144 lines (121 loc) · 3.2 KB
/
prov.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/bin/bash
#
# Config
#
ECLIPSE_ARCHIVE=eclipse-emoflon-linux-user
set -e
START_PWD=$PWD
#
# Utils
#
# Displays the given input including "=> " on the console.
log () {
echo "=> $1"
}
#
# Script
#
log "Start provisioning."
# Updates
log "Installing updates."
sudo apt-get update
sudo apt-get upgrade -y
# Java/JDK11
log "Installing OpenJDK."
sudo apt-get install -y openjdk-11-jdk
#java --version
# Packages for building a new kernel
sudo apt-get install -y gcc make perl
# eMoflon Eclipse
log "Installing eMoflon Eclipse."
sudo apt-get install -y graphviz
mkdir -p ~/eclipse-apps
cd ~/eclipse-apps
# Get eclipse
if [[ ! -f "./$ECLIPSE_ARCHIVE.zip" ]]; then
log "Downloading latest eMoflon Eclipse archive from Github."
curl -s --header "Authorization: Bearer ${GITHUB_TOKEN}" \
https://api.github.com/repos/eMoflon/emoflon-neo-eclipse-build/releases/latest \
| grep "$ECLIPSE_ARCHIVE.zip" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -q --header="Authorization: Bearer ${GITHUB_TOKEN}" -i - \
|| :
fi
if [[ ! -f "./$ECLIPSE_ARCHIVE.zip" ]]; then
log "Download of eMoflon Eclipse archive failed."
exit 1;
fi
unzip -qq -o $ECLIPSE_ARCHIVE.zip
rm -f $ECLIPSE_ARCHIVE.zip
# Create desktop launchers
mkdir -p /home/vagrant/Desktop
touch /home/vagrant/Desktop/emoflon-app.desktop
printf "
[Desktop Entry]
Version=1.0
Name=eMoflon::Neo Eclipse
Comment=Use eMoflon::Neo Eclipse
GenericName=eMoflon::Neo Eclipse
Exec=bash -c \"cd /home/vagrant/eclipse-apps/eclipse && ./eclipse\"
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=/home/vagrant/eclipse-apps/eclipse/icon.xpm
StartupNotify=true
" > /home/vagrant/Desktop/emoflon-app.desktop
touch /home/vagrant/Desktop/emoflon-website.desktop
printf "
[Desktop Entry]
Encoding=UTF-8
Name=eMoflon::Neo Website
Type=Link
URL=https://emoflon.org/neo
Icon=web-browser
" > /home/vagrant/Desktop/emoflon-website.desktop
#touch /home/vagrant/Desktop/emoflon-tutorial.desktop
#printf "
#[Desktop Entry]
#Encoding=UTF-8
#Name=eMoflon::IBeX Tutorial
#Type=Link
#URL=https://github.com/eMoflon/emoflon-ibex-tutorial/releases/latest
#Icon=web-browser
#" > /home/vagrant/Desktop/emoflon-tutorial.desktop
touch /home/vagrant/Desktop/emoflon-tests.desktop
printf "
[Desktop Entry]
Encoding=UTF-8
Name=eMoflon::Neo Test Suite
Type=Link
URL=https://github.com/eMoflon/emoflon-neo/blob/master/projectSetRuntime.psf
Icon=web-browser
" > /home/vagrant/Desktop/emoflon-tests.desktop
touch /home/vagrant/Desktop/neo4j.desktop
printf "
[Desktop Entry]
Encoding=UTF-8
Name=Neo4j Browser
Type=Link
URL=http://localhost:7474
Icon=web-browser
" > /home/vagrant/Desktop/neo4j.desktop
chmod u+x /home/vagrant/Desktop/*.desktop
# Neo4j installation
# https://debian.neo4j.com/
log "Install Neo4j."
wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add -
echo 'deb https://debian.neo4j.com stable 4.2' | sudo tee /etc/apt/sources.list.d/neo4j.list
sudo apt-get update
sudo apt-get install -y neo4j
sudo systemctl enable neo4j
log "Clean-up"
sudo apt-get remove -yq \
libreoffice-* \
thunderbird \
pidgin \
gimp \
evolution
sudo apt-get autoremove -yq
sudo apt-get clean cache
log "Finished provisioning."