forked from tfmagician/setup_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitorious
executable file
·621 lines (529 loc) · 21.2 KB
/
gitorious
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
#!/bin/bash
#################################################
# Installer script for Gitorious
#
# This script was tested with Ubuntu 10.04 TLS.
#
# required:
# Git
# RubyOnRails
# Passenger
# MySQL
#
# Author : Takahiro Fujiwara ( tfmagician )
# Created : 2010-12-04
# Updated : 2010-12-05
#################################################
# Check executable user.
if [ "`whoami`" != "root" ]; then
echo "You need to be root to run this!"
exit 2
fi
# Get some settings.
while [ -z $DOMAIN ]; do
echo -n 'Enter your domain you want to use for Gitorious service. > '
read DOMAIN
done
while [ -z $DB_USER ]; do
echo -n 'Enter user name for database for Gitorious. > '
read DB_USER
done
while [ -z $DB_PASSWD ]; do
echo -n 'Enter password for database for Gitorious. > '
read DB_PASSWD
done
while [ -z $ADMIN_MAIL ]; do
echo -n 'Enter your mail address for Gitorious admin. > '
read ADMIN_MAIL
done
##
echo 'Install Sphinx'
mkdir ~/src
cd ~/src
wget http://www.sphinxsearch.com/downloads/sphinx-0.9.8.tar.gz
tar xvfz sphinx-0.9.8.tar.gz
cd sphinx-0.9.8
./configure
make && make install
gem install --no-ri --no-rdoc ultrasphinx
##
echo 'Download and install ActiveMQ'
apt-get install -y uuid uuid-dev openjdk-6-jre
cd ~/src
wget http://www.powertech.no/apache/dist/activemq/apache-activemq/5.2.0/apache-activemq-5.2.0-bin.tar.gz
tar xzvf apache-activemq-5.2.0-bin.tar.gz -C /usr/local/
sh -c 'echo "export ACTIVEMQ_HOME=/usr/local/apache-activemq-5.2.0" >> /etc/activemq.conf'
sh -c 'echo "export JAVA_HOME=/usr/" >> /etc/activemq.conf'
adduser --system --no-create-home activemq
chown -R activemq /usr/local/apache-activemq-5.2.0/data
cp /usr/local/apache-activemq-5.2.0/conf/activemq.xml /usr/local/apache-activemq-5.2.0/conf/activemq.xml.org
cat > /usr/local/apache-activemq-5.2.0/conf/activemq.xml <<XML
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- START SNIPPET: example -->
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
<!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>file:///\${activemq.base}/conf/credentials.properties</value>
</property>
</bean>
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="\${activemq.base}/data">
<!-- Destination specific policies using destination names or wildcards -->
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry queue=">" memoryLimit="5mb"/>
<policyEntry topic=">" memoryLimit="5mb">
<!-- you can add other policies too such as these
<dispatchPolicy>
<strictOrderDispatchPolicy/>
</dispatchPolicy>
<subscriptionRecoveryPolicy>
<lastImageSubscriptionRecoveryPolicy/>
</subscriptionRecoveryPolicy>
-->
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
<!-- Use the following to configure how ActiveMQ is exposed in JMX -->
<managementContext>
<managementContext createConnector="false"/>
</managementContext>
<!-- The store and forward broker networks ActiveMQ will listen to -->
<networkConnectors>
<!-- by default just auto discover the other brokers -->
<!-- <networkConnector name="default-nc" uri="multicast://default"/> -->
<!-- Example of a static configuration:
<networkConnector name="host1 and host2" uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
-->
<networkConnector name="localhost" uri="static://(tcp://127.0.0.1:61616)"/>
</networkConnectors>
<persistenceAdapter>
<amqPersistenceAdapter syncOnWrite="false" directory="\${activemq.base}/data" maxFileLength="20 mb"/>
</persistenceAdapter>
<!-- Use the following if you wish to configure the journal with JDBC -->
<!--
<persistenceAdapter>
<journaledJDBC dataDirectory="\${activemq.base}/data" dataSource="#postgres-ds"/>
</persistenceAdapter>
-->
<!-- Or if you want to use pure JDBC without a journal -->
<!--
<persistenceAdapter>
<jdbcPersistenceAdapter dataSource="#postgres-ds"/>
</persistenceAdapter>
-->
<sslContext>
<sslContext keyStore="file:\${activemq.base}/conf/broker.ks" keyStorePassword="password" trustStore="file:\${activemq.base}/conf/broker.ts" trustStorePassword="password"/>
</sslContext>
<!-- The maximum about of space the broker will use before slowing down producers -->
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsage limit="20 mb"/>
</memoryUsage>
<storeUsage>
<storeUsage limit="1 gb" name="foo"/>
</storeUsage>
<tempUsage>
<tempUsage limit="100 mb"/>
</tempUsage>
</systemUsage>
</systemUsage>
<!-- The transport connectors ActiveMQ will listen to -->
<transportConnectors>
<transportConnector name="openwire" uri="tcp://localhost:61616" discoveryUri="multicast://default"/>
<transportConnector name="ssl" uri="ssl://localhost:61617"/>
<transportConnector name="stomp" uri="stomp://localhost:61613"/>
<transportConnector name="xmpp" uri="xmpp://localhost:61222"/>
</transportConnectors>
</broker>
<!--
** Lets deploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker
** For more details see
**
** http://activemq.apache.org/enterprise-integration-patterns.html
-->
<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
<!-- You can use a <package> element for each root package to search for Java routes -->
<package>org.foo.bar</package>
<!-- You can use Spring XML syntax to define the routes here using the <route> element -->
<route>
<from uri="activemq:example.A"/>
<to uri="activemq:example.B"/>
</route>
</camelContext>
<!--
** Lets configure some Camel endpoints
**
** http://activemq.apache.org/camel/components.html
-->
<!-- configure the camel activemq component to use the current broker -->
<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent" >
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="vm://localhost?create=false&waitForStart=10000" />
<property name="userName" value="\${activemq.username}"/>
<property name="password" value="\${activemq.password}"/>
</bean>
</property>
</bean>
<!-- Uncomment to create a command agent to respond to message based admin commands on the ActiveMQ.Agent topic -->
<!--
<commandAgent xmlns="http://activemq.apache.org/schema/core" brokerUrl="vm://localhost" username="\${activemq.username}" password="\${activemq.password}"/>
-->
<!-- An embedded servlet engine for serving up the Admin console -->
<jetty xmlns="http://mortbay.com/schemas/jetty/1.0">
<connectors>
<nioConnector port="8161"/>
</connectors>
<handlers>
<webAppContext contextPath="/admin" resourceBase="\${activemq.base}/webapps/admin" logUrlOnStart="true"/>
<webAppContext contextPath="/demo" resourceBase="\${activemq.base}/webapps/demo" logUrlOnStart="true"/>
<webAppContext contextPath="/fileserver" resourceBase="\${activemq.base}/webapps/fileserver" logUrlOnStart="true"/>
</handlers>
</jetty>
<!-- This xbean configuration file supports all the standard spring xml configuration options -->
<!-- Postgres DataSource Sample Setup -->
<!--
<bean id="postgres-ds" class="org.postgresql.ds.PGPoolingDataSource">
<property name="serverName" value="localhost"/>
<property name="databaseName" value="activemq"/>
<property name="portNumber" value="0"/>
<property name="user" value="activemq"/>
<property name="password" value="activemq"/>
<property name="dataSourceName" value="postgres"/>
<property name="initialConnections" value="1"/>
<property name="maxConnections" value="10"/>
</bean>
-->
<!-- MySql DataSource Sample Setup -->
<!--
<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost/activemq?relaxAutoCommit=true"/>
<property name="username" value="activemq"/>
<property name="password" value="activemq"/>
<property name="maxActive" value="200"/>
<property name="poolPreparedStatements" value="true"/>
</bean>
-->
<!-- Oracle DataSource Sample Setup -->
<!--
<bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
<property name="url" value="jdbc:oracle:thin:@localhost:1521:AMQDB"/>
<property name="username" value="scott"/>
<property name="password" value="tiger"/>
<property name="maxActive" value="200"/>
<property name="poolPreparedStatements" value="true"/>
</bean>
-->
<!-- Embedded Derby DataSource Sample Setup -->
<!--
<bean id="derby-ds" class="org.apache.derby.jdbc.EmbeddedDataSource">
<property name="databaseName" value="derbydb"/>
<property name="createDatabase" value="create"/>
</bean>
-->
</beans>
<!-- END SNIPPET: example -->
XML
cd ~/src
wget http://launchpadlibrarian.net/15645459/activemq
mv activemq /etc/init.d/activemq
chmod +x /etc/init.d/activemq
##
echo 'Install Memcache'
apt-get install -y memcached
update-rc.d memcached defaults
##
echo 'Get the Gitorious source code'
useradd -d /var/www/${DOMAIN} -m gitorious
chmod -R g+sw /var/www/${DOMAIN}
cd /var/www/${DOMAIN}
mkdir log
mkdir conf
git clone git://gitorious.org/gitorious/mainline.git gitorious
ln -s /var/www/${DOMAIN}/gitorious/script/gitorious /usr/local/bin/gitorious
cd gitorious/
rm public/.htaccess
mkdir -p tmp/pids
chown -R gitorious:gitorious ../gitorious
chmod ug+x script/*
chmod -R g+w config/ log/ public/ tmp/
cp /var/www/${DOMAIN}/gitorious/doc/templates/ubuntu/git-daemon /var/www/${DOMAIN}/gitorious/doc/templates/ubuntu/git-daemon.org
sed -i "s/^GIT_DAEMON=.\+$/GIT_DAEMON=\"\/usr\/bin\/ruby \/var\/www\/${DOMAIN}\/gitorious\/script\/git-daemon -d\"/g" /var/www/${DOMAIN}/gitorious/doc/templates/ubuntu/git-daemon
sed -i "s/^PID_FILE=.\+$/PID_FILE=\/var\/www\/${DOMAIN}\/gitorious\/log\/git-daemon.pid/g" /var/www/${DOMAIN}/gitorious/doc/templates/ubuntu/git-daemon
ln -s /var/www/${DOMAIN}/gitorious/doc/templates/ubuntu/git-ultrasphinx /etc/init.d/git-ultrasphinx
ln -s /var/www/${DOMAIN}/gitorious/doc/templates/ubuntu/git-daemon /etc/init.d/git-daemon
chmod +x /etc/init.d/git-ultrasphinx
chmod +x /etc/init.d/git-daemon
update-rc.d -f git-daemon start 99 2 3 4 5 .
update-rc.d -f git-ultrasphinx start 99 2 3 4 5 .
##
echo 'Creating a home for Git repositories'
useradd -m git
usermod -a -G gitorious git
mkdir /var/git
mkdir /var/git/repositories
mkdir /var/git/tarballs
mkdir /var/git/tarball-work
mkdir /home/git/repositories
chown -R git:git /var/git
chown -R git:git /home/git
su git -c 'mkdir ~/.ssh'
su git -c 'chmod 700 ~/.ssh'
su git -c 'touch ~/.ssh/authorized_keys'
##
echo 'Configure Gitorious and migrate database'
cd /var/www/${DOMAIN}/gitorious
cp -a config/database.sample.yml config/database.yml
cp -a config/gitorious.sample.yml config/gitorious.yml
cp -a config/broker.yml.example config/broker.yml
cat > config/database.yml <<CONF
# MySQL (default setup). Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql
# On MacOS X:
# gem install mysql -- --include=/usr/local/lib
# On Windows:
# gem install mysql
# Choose the win32 build.
# Install MySQL and put its /bin directory on your path.
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql
database: gitorious_dev
username: ${DB_USER}
password: ${DB_PASSWD}
host: localhost
encoding: utf8
# Warning: The database defined as 'test' will be erased and
# re-generated from your development database when you run 'rake'.
# Do not set this db to the same as development or production.
test:
adapter: mysql
database: gitorious_test
username: ${DB_USER}
password: ${DB_PASSWD}
host: localhost
encoding: utf8
production:
adapter: mysql
database: gitorious
username: ${DB_USER}
password: ${DB_PASSWD}
host: localhost
encoding: utf8
CONF
SECRET_KEY=`apg -m 64 | sed ':a;N;$!ba;s/\n/ /g' | sed 's/ //g'`
cat > config/gitorious.yml <<CONF
development:
# The session secret key (\`apg -m 64\` is always useful for this kinda stuff)
cookie_secret: ${SECRET_KEY}
# The path where git repositories are stored. The actual (bare) repositories
# resides in repository_base_path/#{project.slug}/#{repository.name}.git/:
repository_base_path: "/var/git/repositories"
# Stuff that's in the html <head>. custom stats javascript code etc
extra_html_head_data:
# System message that will appear on all pages if present
system_message:
# Port the ./script/gitorious script should use:
gitorious_client_port: 3000
# Host the ./script/gitorious script should use:
gitorious_client_host: git.local
# Host which is serving the gitorious app, eg "gitorious.org"
gitorious_host: git.local
# User which is running git daemon
gitorious_user: git
# Email spam on server errors to:
exception_notification_emails: christianATcjohansen.no
# Mangle visible e-mail addresses (spam protection)
mangle_email_addresses: true
# Enable or Disable Public Mode (true) or Private Mode (false)
public_mode: false
# Define your locale
locale: en
# Where should we store generated tarballs?
# (should be readable by webserver, since we tell it to send the file using
# X-Sendfile)
archive_cache_dir: "/var/git/tarballs"
# Which directory should we work in when we generate tarballs, before moving
# them to the above dir?
archive_work_dir: "/var/git/tarballs-work"
# is it only site admins who can create new projects?
only_site_admins_can_create_projects: true
# Should we hide HTTP clone urls?
hide_http_clone_urls: false
# Is this gitorious.org? Read: should we have a very flashy homepage?
is_gitorious_dot_org: false
production:
cookie_secret: ${SECRET_KEY}
repository_base_path: "/home/git/repositories"
extra_html_head_data:
system_message:
gitorious_client_port: 80
gitorious_client_host: ${DOMAIN}
gitorious_host: ${DOMAIN}
gitorious_user: git
exception_notification_emails: `echo ${ADMIN_MAIL} | sed 's/@/AT/g'`
mangle_email_addresses: true
public_mode: false
locale: en
archive_cache_dir: "/var/git/tarballs"
archive_work_dir: "/var/git/tarballs-work"
only_site_admins_can_create_projects: true
hide_http_clone_urls: false
is_gitorious_dot_org: false
test:
cookie_secret: ${SECRET_KEY}
repository_base_path: "/var/git/repositories"
extra_html_head_data:
system_message:
gitorious_client_port: 3000
gitorious_client_host: localhost
gitorious_host: localhost
gitorious_user: git
exception_notification_emails: christianATcjohansen.no
mangle_email_addresses: true
public_mode: true
locale: en
archive_cache_dir: "/var/git/tarballs"
archive_work_dir: "/var/git/tarballs-work"
only_site_admins_can_create_projects: false
hide_http_clone_urls: false
is_gitorious_dot_org: false
CONF
echo 'SslRequirement.disable_ssl_check = true' >> /var/www/${DOMAIN}/gitorious/config/environments/production.rb
##
echo 'Install remaining gems and migrate database'
while [ -z $ROOT_PASS ]; do
echo -n ' Enter your root password for MySQL > '
read ROOT_PASS
done
cat | mysql -uroot -p${ROOT_PASS} <<SQL
create database gitorious;
create database gitorious_test;
create database gitorious_dev;
grant all privileges on gitorious.* to ${DB_USER}@localhost \
identified by '${DB_PASSWD}';
grant all privileges on gitorious_test.* to ${DB_USER}@localhost;
grant all privileges on gitorious_dev.* to ${DB_USER}@localhost;
SQL
rake gems:install
rake db:migrate RAILS_ENV=production
##
echo 'Add a Site Admin'
cd /var/www/${DOMAIN}/gitorious
env RAILS_ENV=production ruby script/create_admin
cat <<MSG
Activate the admin user on ruby console like this.
> user = User.first
> user.login = "christian" # Change to your desired username
> user.activate
> user.accept_terms
> user.save
MSG
env RAILS_ENV=production ruby script/console
##
echo 'Get Ultrasphinx running'
su gitorious -c "cd /var/www/${DOMAIN}/gitorious && rake ultrasphinx:bootstrap RAILS_ENV=production"
##
echo 'Setup Permissons Right'
cd /var/www/${DOMAIN}/gitorious
chown -R git:gitorious config/environment.rb script/poller log tmp
chmod -R g+w config/environment.rb script/poller log tmp
chmod ug+x script/poller
##
echo 'Setup Ultrasphinx indexing cronjob'
su gitorious -c "echo \"* */1 * * * cd /var/www/${DOMAIN}/gitorious && rake ultrasphinx:index RAILS_ENV=production\" | crontab"
##
echo 'Setup logrotate'
cd /var/www/${DOMAIN}/gitorious
cp doc/templates/ubuntu/gitorious-logrotate /etc/logrotate.d/gitorious
chmod +x /etc/logrotate.d/gitorious
cat > /etc/logrotate.d/gitorious <<CONF
/var/www/${DOMAIN}/gitorious/log/*log {
missingok
notifempty
sharedscripts
postrotate
/etc/init.d/git-daemon restart > /dev/null 2>/dev/null || true
/etc/init.d/git-ultrasphinx restart > /dev/null 2>/dev/null || true
/bin/touch /var/www/${DOMAIN}/gitorious/tmp/restart.txt > /dev/null 2>/dev/null || true
endscript
}
CONF
##
echo 'Create virtual host setting'
cat > /var/www/${DOMAIN}/conf/vhost.conf <<CONF
<VirtualHost *:80>
<Directory /var/www/${DOMAIN}/gitorious/public>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from All
</Directory>
DocumentRoot /var/www/${DOMAIN}/gitorious/public
ServerName ${DOMAIN}
ErrorLog /var/www/${DOMAIN}/log/error.log
CustomLog /var/www/${DOMAIN}/log/access.log combined
# Gzip/Deflate
# http://fluxura.com/2006/5/19/apache-for-static-and-mongrel-for-rails-with-mod_deflate-and-capistrano-support
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Far future expires date
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
ExpiresActive On
ExpiresDefault "access plus 1 year"
</FilesMatch>
# No Etags
FileETag None
RewriteEngine On
# Check for maintenance file and redirect all requests
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [L]
</VirtualHost>
CONF
ln -s /var/www/${DOMAIN}/conf/vhost.conf /etc/apache2/sites-available/${DOMAIN}
a2ensite ${DOMAIN}
##
echo 'Run Gitorious processes'
cat <<MSG
Now, run all the services:
sudo /etc/init.d/activemq start
sudo env RAILS_ENV=production /etc/init.d/git-daemon start
su git -c \
"cd /var/www/${DOMAIN}/gitorious && \
env RAILS_ENV=production script/poller run"
Later, you can use script/poller start to run the poller in the background.
For debugging, it's better to be able to follow the output.
The gitorious script runs with the production environment as default, so we'll start the application in production mode.
MSG