FFFF ファイルとディレクトリ構成の整理 (#151) by tkmtmkt · Pull Request #156 · alminium/alminium · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "theme/railsgun"]
path = theme/railsgun
[submodule "redmine/public/themes/railsgun"]
path = redmine/public/themes/railsgun
url = https://github.com/alminium/redmine_railsgun_theme
[submodule "theme/gitmike"]
path = theme/gitmike
[submodule "redmine/public/themes/gitmike"]
path = redmine/public/themes/gitmike
url = https://github.com/makotokw/redmine-theme-gitmike
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
LoadModule passenger_module /usr/lib/ruby/gems/1.9.1/gems/passenger-%PASSENGER_VERSION%/buildout/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.9.1/gems/passenger-%PASSENGER_VERSION%
PassengerRuby /usr/bin/ruby1.9.3

<VirtualHost *:80>
ServerName %HOSTNAME%
ServerAlias localhost
Expand Down
File renamed without changes.
4 changes: 0 additions & 4 deletions inst-script/mac/httpd-redmine.conf → etc/mac/redmine.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
LoadModule passenger_module /opt/local/lib/ruby1.9/gems/1.9.1/gems/passenger-%PASSENGER_VERSION%/ext/apache2/mod_passenger.so
PassengerRoot /opt/local/lib/ruby1.9/gems/1.9.1/gems/passenger-%PASSENGER_VERSION%
PassengerRuby /opt/local/bin/ruby1.9

<VirtualHost *:80>
ServerName %HOSTNAME%:80
DocumentRoot /opt/alminium/public
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
LoadModule passenger_module /usr/lib64/ruby/gems/2.1.0/gems/passenger-%PASSENGER_VERSION%/buildout/apache2/mod_passenger.so
PassengerRoot /usr/lib64/ruby/gems/2.1.0/gems/passenger-%PASSENGER_VERSION%
PassengerRuby /usr/bin/ruby

<VirtualHost *:80>
ServerName %HOSTNAME%
DocumentRoot /opt/alminium/public
Expand Down
File renamed without changes.
11 changes: 9 additions & 2 deletions inst-script/debian/jenkins-install
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fi

if [ ! -f /etc/apache2/sites-available/jenkins ]
then
cp inst-script/debian/httpd-jenkins.conf /etc/apache2/sites-available/jenkins
cp etc/debian/jenkins.conf /etc/apache2/sites-available/jenkins
a2ensite jenkins
fi

Expand Down Expand Up @@ -59,6 +59,11 @@ then
#service jenkins restart
fi

# jenkinsプラグインファイルをカレントディレクトリにダウンロードしてから
# インストールしているようなので、redmineがインストールできない。
# 暫定回避策としてtmpディレクトリ内に移動してから処理する。
mkdir tmp
pushd tmp
RET=-1
until [ "$RET" -eq "0" ]
do
Expand All @@ -72,12 +77,14 @@ java -jar $INSTALL_DIR/bin/jenkins-cli.jar -s http://localhost:8080/jenkins/ ins
java -jar $INSTALL_DIR/bin/jenkins-cli.jar -s http://localhost:8080/jenkins/ install-plugin git
java -jar $INSTALL_DIR/bin/jenkins-cli.jar -s http://localhost:8080/jenkins/ install-plugin redmine
java -jar $INSTALL_DIR/bin/jenkins-cli.jar -s http://localhost:8080/jenkins/ install-plugin dashboard-view
popd
rm -rf tmp

sleep 10

if [ ! -f /var/lib/jenkins/config.xml ]
then
cp config/jenkins-config.xml /var/lib/jenkins/config.xml
cp jenkins/config.xml /var/lib/jenkins/config.xml
fi

java -jar $INSTALL_DIR/bin/jenkins-cli.jar -s http://localhost:8080/jenkins/ restart
Expand Down
11 changes: 4 additions & 7 deletions inst-script/debian/post-install
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
if [ ! -f /etc/perl/Apache/Authn/Redmine.pm ]
then
mkdir -p /etc/perl/Apache/Authn
cat config/Redmine.pm |sed 's/Digest::SHA1/Digest::SHA/g' > /etc/perl/Apache/Authn/Redmine.pm
cat etc/Redmine.pm |sed 's/Digest::SHA1/Digest::SHA/g' > /etc/perl/Apache/Authn/Redmine.pm
fi

if [ ! -f /etc/apache2/sites-available/redmine ]
then
PASSENGER_VERSION=`passenger-config --version`

sed 's/%HOSTNAME%/'$HOSTNAME'/' inst-script/debian/httpd-redmine.conf |\
sed 's/%PASSENGER_VERSION%/'$PASSENGER_VERSION'/' > /etc/apache2/sites-available/redmine
sed 's/%HOSTNAME%/'$HOSTNAME'/' inst-script/debian/httpd-vcs.conf > /etc/apache2/sites-available/vcs
sed 's/%HOSTNAME%/'$HOSTNAME'/' etc/debian/redmine.conf > /etc/apache2/sites-available/redmine
sed 's/%HOSTNAME%/'$HOSTNAME'/' etc/debian/vcs.conf > /etc/apache2/sites-available/vcs
fi

a2enmod expires
Expand All @@ -26,4 +23,4 @@ a2ensite redmine
a2ensite vcs

service apache2 stop
service apache2 start
service apache2 start
34 changes: 2 additions & 32 deletions inst-script/gems
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ then
fi

# インストールするディレクトリ名
NAME=(`grep -v "^#" config/rubygems.lst | awk -F, '{print $1}'`)
VER=(`grep -v "^#" config/rubygems.lst | awk -F, '{print $2}'`)
NAME=(`grep -v "^#" inst-script/rubygems.lst | awk -F, '{print $1}'`)
VER=(`grep -v "^#" inst-script/rubygems.lst | awk -F, '{print $2}'`)

for (( i = 0; i < ${#NAME[@]}; ++i ))
do
Expand All @@ -23,33 +23,3 @@ do
$GEM install -f $NAME -v=$VER --no-rdoc --no-ri
fi
done


## install mod_passenger
case $OS in
rhel6)
if [ ! -f /usr/lib64/ruby/gems/2.1.0/gems/passenger-4.*/buildout/apache2/mod_passenger.so ]
then
$GEM install passenger --no-rdoc --no-ri
passenger-install-apache2-module --auto
fi
;;
mac)
if [ ! -f /opt/local/lib/ruby2.0/gems/2.0.0/gems/passenger-4.*/buildout/apache2/mod_passenger.so ]
then
$GEM install passenger --no-rdoc --no-ri
export APXS2=/opt/local/apache2/bin/apxs
export PATH=/opt/local/apache2/bin:$PATH
passenger-install-apache2-module --auto
fi
;;
debian)
if [ ! -f /var/lib/gems/2.0.0/gems/passenger-4.0.*/buildout/apache2/mod_passenger.so ]
then
$GEM install thin
$GEM install passenger --no-rdoc --no-ri
passenger-install-apache2-module --auto
fi
;;

esac
8 changes: 3 additions & 5 deletions inst-script/mac/post-install
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,22 @@ cp inst-script/mac/scm.yml.mac $INSTALL_DIR/config/scm.yml
if [ ! -f /opt/local/apache2/Authn/Redmine.pm ]
then
mkdir -p /opt/local/apache2/Authn
cp config/Redmine.pm /opt/local/apache2/Authn/
cp etc/Redmine.pm /opt/local/apache2/Authn/
fi

if [ ! -f /opt/local/apache2/conf/redmine.conf ]
then
mkdir -p /opt/local/apache2/conf
PASSENGER_VERSION=`passenger-config --version`

sed 's/%HOSTNAME%/'$HOSTNAME'/' inst-script/mac/httpd-redmine.conf | \
sed 's/%PASSENGER_VERSION%/'$PASSENGER_VERSION'/' |
sed 's/%HOSTNAME%/'$HOSTNAME'/' etc/mac/redmine.conf |
if [ "$SSL" = "y" ]
then
sed 's/#Rewrite/Rewrite/'
else
cat
fi > /opt/local/apache2/conf/redmine.conf

sed 's/%HOSTNAME%/'$HOSTNAME'/' inst-script/mac/httpd-vcs.conf > /opt/local/apache2/conf/vcs.conf
sed 's/%HOSTNAME%/'$HOSTNAME'/' etc/mac/vcs.conf > /opt/local/apache2/conf/vcs.conf

if [ "$SSL" = "y" ]
then
Expand Down
12 changes: 9 additions & 3 deletions inst-script/rhel6/jenkins-install
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fi

if [ ! -f /etc/httpd/conf.d/jenkins.conf ]
then
cp inst-script/rhel6/httpd-jenkins.conf /etc/httpd/conf.d/jenkins.conf
cp etc/rhel6/jenkins.conf /etc/httpd/conf.d/jenkins.conf
fi

sed -i 's/JENKINS_ARGS=""/JENKINS_ARGS="--prefix=\/jenkins"/' /etc/sysconfig/jenkins
Expand Down Expand Up @@ -79,6 +79,11 @@ then
#service jenkins restart
fi

# jenkinsプラグインファイルをカレントディレクトリにダウンロードしてから
# インストールしているようなので、redmineがインストールできない。
# 暫定回避策としてtmpディレクトリ内に移動してから処理する。
mkdir tmp
pushd tmp
RET=-1
until [ "$RET" -eq "0" ]
do
Expand All @@ -92,14 +97,15 @@ java -jar $INSTALL_DIR/bin/jenkins-cli.jar -s http://localhost:8080/jenkins/ ins
java -jar $INSTALL_DIR/bin/jenkins-cli.jar -s http://localhost:8080/jenkins/ install-plugin git
java -jar $INSTALL_DIR/bin/jenkins-cli.jar -s http://localhost:8080/jenkins/ install-plugin redmine
java -jar $INSTALL_DIR/bin/jenkins-cli.jar -s http://localhost:8080/jenkins/ install-plugin dashboard-view
popd
rm -rf tmp

sleep 10

if [ ! -f /var/lib/jenkins/config.xml ]
then
cp config/jenkins-config.xml /var/lib/jenkins/config.xml
cp jenkins/config.xml /var/lib/jenkins/config.xml
fi


java -jar $INSTALL_DIR/bin/jenkins-cli.jar -s http://localhost:8080/jenkins/ restart

10 changes: 4 additions & 6 deletions inst-script/rhel6/post-install
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@
if [ ! -f /etc/httpd/Apache/Authn/Redmine.pm ]
then
mkdir -p /etc/httpd/Apache/Authn
cp config/Redmine.pm /etc/httpd/Apache/Authn/
cp etc/Redmine.pm /etc/httpd/Apache/Authn/
fi

if [ ! -f /etc/httpd/conf.d/redmine.conf ]
then
PASSENGER_VERSION=`passenger-config --version`
sed 's/%HOSTNAME%/'$HOSTNAME'/' inst-script/rhel6/httpd-redmine.conf | \
sed 's/%PASSENGER_VERSION%/'$PASSENGER_VERSION'/' |
sed 's/%HOSTNAME%/'$HOSTNAME'/' etc/rhel6/redmine.conf |
if [ "$SSL" = "y" ]
then
sed 's/#Rewrite/Rewrite/'
else
cat
fi > /etc/httpd/conf.d/redmine.conf
sed 's/%HOSTNAME%/'$HOSTNAME'/' inst-script/rhel6/httpd-vcs.conf > /etc/httpd/conf.d/vcs.conf
sed 's/%HOSTNAME%/'$HOSTNAME'/' etc/rhel6/vcs.conf > /etc/httpd/conf.d/vcs.conf
if [ "$SSL" = "y" ]
then
CHK=`grep "^DocumentRoot /opt/alminium/public" /etc/httpd/conf.d/ssl.conf`
Expand All @@ -27,7 +25,7 @@ then
sed -i 's/#ServerName www.example.com:443/ServerName '$HOSTNAME':443/' /etc/httpd/conf.d/ssl.conf
fi
fi
cp -f inst-script/rhel6/httpd-maven.conf /etc/httpd/conf.d/maven.conf
cp -f etc/rhel6/maven.conf /etc/httpd/conf.d/maven.conf
fi

# セキュリティ無効化の設定
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions inst-script/redmine-plugins → redmine/setup/redmine-plugins
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash

# インストールするディレクトリ名
DEST_NAME=(`grep -v "^#" config/redmine-plugins.lst | awk -F, '{print $1}'`)
DEST_NAME=(`grep -v "^#" redmine/setup/redmine-plugins.lst | awk -F, '{print $1}'`)

# 展開したアーカイブのディレクトリ名 or タグ名
DIR_NAME=(`grep -v "^#" config/redmine-plugins.lst | awk -F, '{print $2}'`)
DIR_NAME=(`grep -v "^#" redmine/setup/redmine-plugins.lst | awk -F, '{print $2}'`)

# URL
URL_NAME=(`grep -v "^#" config/redmine-plugins.lst | awk -F, '{print $3}'`)
URL_NAME=(`grep -v "^#" redmine/setup/redmine-plugins.lst | awk -F, '{print $3}'`)

for (( i = 0; i < ${#DIR_NAME[@]}; ++i ))
do
Expand Down
File renamed without changes.
25 changes: 16 additions & 9 deletions smelt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Smart installer for redmine/chiliproject.
############################################################


export RAILS_ENV=production
export INSTALL_DIR=/opt/alminium
export SCRIPT_DIR=`pwd`
Expand Down Expand Up @@ -37,6 +38,7 @@ fi
if [ -f /etc/redhat-release ]
then
APACHE_USER=apache
APACHE_CONF_DIR=/etc/httpd/conf.d
MYSQLD='/etc/init.d/mysqld'
MYSQL='mysql'
CHK=`egrep "CentOS release 5|Red Hat Enterprise Linux .* 5" /etc/redhat-release`
Expand All @@ -54,6 +56,7 @@ then
elif [ -f /etc/system-release ]
then
APACHE_USER=apache
APACHE_CONF_DIR=/etc/httpd/conf.d
MYSQLD='/etc/init.d/mysqld'
MYSQL='mysql'
CHK=`egrep "Amazon Linux AMI" /etc/system-release`
Expand All @@ -66,6 +69,7 @@ elif [ -f /etc/debian_version ]
then
OS='debian'
APACHE_USER=www-data
APACHE_CONF_DIR=/etc/apache2/conf.d
MYSQLD='/etc/init.d/mysql'
# TODO: -u -pを指定するとcreatedb.sqlの読み込みに失敗する
# MYSQL="$MYSQL -u root -p"
Expand All @@ -81,6 +85,7 @@ else
then
OS='mac'
APACHE_USER=www
APACHE_CONF_DIR=/opt/local/apache2/conf
MYSQLD=/opt/local/share/mysql55/support-files/mysql.server
MYSQLD=mysql
CPCMD='cp -Rf'
Expand Down Expand Up @@ -220,7 +225,7 @@ then
fi
fi

$MYSQL < config/createdb.sql
$MYSQL < redmine/setup/createdb.sql

# install chiliproject
mkdir -p $INSTALL_DIR
Expand Down Expand Up @@ -258,10 +263,9 @@ then
$RMCMD cache/redmine-$RM_VER
fi

cp config/Gemfile.local $INSTALL_DIR/
cp config/database.yml $INSTALL_DIR/config/
cp config/scm.yml $INSTALL_DIR/config/
$CPCMD theme/* $INSTALL_DIR/public/themes/
cp redmine/Gemfile.local $INSTALL_DIR/
$CPCMD redmine/config/* $INSTALL_DIR/config/
$CPCMD redmine/public/themes/* $INSTALL_DIR/public/themes/

# setup
pushd .
Expand All @@ -270,26 +274,29 @@ cd $INSTALL_DIR
echo "*** execute bundle ***"
bundle install --path vendor/bundler --without development test postgresql sqlite

bundle exec passenger-install-apache2-module --auto
bundle exec passenger-install-apache2-module --snippet > $APACHE_CONF_DIR/passenger.conf

bundle exec $RAKE generate_secret_token
bundle exec $RAKE db:migrate
echo "ja" |RAILS_ENV=production bundle exec $RAKE redmine:load_default_data

popd

# install plugins
source inst-script/redmine-plugins
source redmine/setup/redmine-plugins

# Customize
echo "*** run initialize SQL ***"
$MYSQL alminium < config/init.mysql
$MYSQL alminium < redmine/setup/init.mysql

mkdir -p /etc/opt/alminium
$CPCMD etc/* /etc/opt/alminium/

mkdir -p $INSTALL_DIR/bin
mkdir -p /var/opt/alminium/git /var/opt/alminium/svn /var/opt/alminium/hg /var/opt/alminium/maven
$CPCMD bin/* $INSTALL_DIR/bin/
$CPCMD hooks $INSTALL_DIR/
$CPCMD redmine/bin/* $INSTALL_DIR/bin/
$CPCMD redmine/hooks $INSTALL_DIR/

#chown $APACHE_USER.$APACHE_USER -R $INSTALL_DIR
#chown $APACHE_USER.$APACHE_USER -R /var/opt/alminium
Expand Down
1 change: 1 addition & 0 deletions uninstall
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ then
rm -fr /etc/httpd/conf.d/jenkins.conf
rm -fr /etc/httpd/conf.d/redmine.conf
rm -fr /etc/httpd/conf.d/vcs.conf
rm -fr /etc/{apache2,httpd}/conf.d/passenger.conf
rm -fr /etc/opt/alminium
fi

Expand Down
0