forked from artefactual/archivematica
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dev-installer
executable file
·146 lines (128 loc) · 4.33 KB
/
dev-installer
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
145
146
#!/bin/bash
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Archivematica is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Archivematica. If not, see <http://www.gnu.org/licenses/>.
# @package Archivematica
# @author Joseph Perry <joseph@artefactual.com>
# @version svn: $Id$
cd `dirname $0`
part="create the archivematica user"
echo -n "\"Would you like to ${part}?\" (y/N) "
read a
if [[ $a == "Y" || $a == "y" ]]; then
echo "Going to ${part} ..."
sudo adduser --uid 333 --group --system --home /var/lib/archivematica/ archivematica
sudo adduser --uid 334 --group --system --home /var/lib/archivematica-django/ archivematicadashboard
sudo gpasswd -a $USER archivematica
sudo gpasswd -a archivematicadashboard archivematica
else
echo "Not going to ${part}"
fi
part="install Gearman"
echo -n "\"Would you like to ${part}?\" (y/N) "
read a
if [[ $a == "Y" || $a == "y" ]]; then
echo "Going to ${part} ..."
sudo apt-get install gearman
sudo apt-get install python-setuptools
sudo apt-get install python-gearman
#sudo easy_install gearman
else
echo "Not going to ${part}"
fi
part="install postfix"
echo -n "\"Would you like to ${part}?\" (y/N) "
read a
if [[ $a == "Y" || $a == "y" ]]; then
echo "Going to ${part} ..."
clear
echo select internet and defaults
read -n1 -r -p "Press any key to continue..." key
sudo apt-get install postfix
else
echo "Not going to ${part}"
fi
part="install/update MySQL"
echo -n "\"Would you like to ${part}?\" (y/N) "
read a
if [[ $a == "Y" || $a == "y" ]]; then
echo "Going to ${part} ..."
sudo apt-get install mysql-server -y
else
echo "Not going to ${part}"
fi
part="install/update Apache"
echo -n "\"Would you like to ${part}?\" (y/N) "
read a
if [[ $a == "Y" || $a == "y" ]]; then
echo "Going to ${part} ..."
sudo apt-get install apache2 -y
else
echo "Not going to ${part}"
fi
part="add ppa repositories"
echo -n "\"Would you like to ${part}?\" (y/N) "
read a
if [[ $a == "Y" || $a == "y" ]]; then
sudo apt-get install python-software-properties -y
sudo add-apt-repository ppa:archivematica/externals-dev
#sudo add-apt-repository ppa:twisted-dev/ppa
sudo apt-get update
else
echo "Not going to ${part}"
fi
part="reinstall archivematica upstart services - requires restart"
echo -n "\"Would you like to ${part}?\" (y/N) "
read a
if [[ $a == "Y" || $a == "y" ]]; then
echo "Going to ${part} ..."
sudo stop archivematica-mcp-client
sleep 1
sudo stop archivematica-mcp-server
sudo rm /etc/init/archivematica-mcp-server.conf /etc/init/archivematica-mcp-client.conf
sudo ln src/MCPServer/init/archivematica-mcp-server.conf /etc/init/
sudo ln src/MCPClient/init/archivematica-mcp-client.conf /etc/init/
else
echo "Not going to ${part}."
fi
part="clone sample data into $HOME"
echo -n "\"Would you like to ${part}?\" (y/N) "
read a
if [[ $a == "Y" || $a == "y" ]]; then
CURRENT_REPO=`git remote -v | head -n 1 | sed "s/\t/ /" | cut -f2 -d" "`
if [ "$CURRENT_REPO" = "git@git.artefactual.com:archivematica" ]; then
SAMPLEDATA_REPO="git@git.artefactual.com:archivematica-sampledata.git"
else
SAMPLEDATA_REPO="https://github.com/artefactual/archivematica-sampledata.git"
fi
DATE=`date +%Y-%m-%d-%M-%S`
git clone $SAMPLEDATA_REPO ~/archivematica-sampledata
echo "Updating OPF..."
cd ~/archivematica-sampledata
git submodule init
git submodule update
else
echo "Not going to ${part}."
fi
exit
part="example"
echo -n "\"Would you like to ${part}?\" (y/N) "
read a
if [[ $a == "Y" || $a == "y" ]]; then
echo "Going to ${part} ..."
else
echo "Not going to ${part}"
fi