forked from alminium/alminium
-
Notifications
You must be signed in to change notification settings - Fork 2
/
smelt
executable file
·110 lines (85 loc) · 2.93 KB
/
smelt
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
#!/bin/bash
############################################################
# Smart installer for ALMinium.
# 第1引数:データベースホスト名
# 第2引数:データベース管理者パスワード
############################################################
ALM_SRC_DIR=${ALM_SRC_DIR:-$(cd $(dirname $0);pwd)}
ALM_ETC_DIR=${ALM_ETC_DIR:-/etc/opt/alminium}
ALM_VAR_DIR=${ALM_VAR_DIR:-/var/opt/alminium}
ALM_INSTALL_DIR=${ALM_INSTALL_DIR:-/opt/alminium}
ALM_LOG_DIR=${ALM_LOG_DIR:-/var/log/alminium}
ALM_ENABLE_AUTO_BACKUP=${ALM_ENABLE_AUTO_BACKUP:-y}
ALM_GIT_VERSION=${ALM_GIT_VERSION:-2.9.0}
ALM_GIT_AUTO_UPGRADE=${ALM_GIT_AUTO_UPGRADE:-N}
ALM_DB_SETUP=${ALM_DB_SETUP:-y}
ALM_DB_HOST=${1:-$ALM_DB_HOST}
ALM_DB_ROOT_PASS=${2:-$ALM_DB_ROOT_PASS}
RAILS_ENV=production
# move to sources directry
cd ${ALM_SRC_DIR}
RM_VER=${RM_VER:-`cat RM_VERSION`}
RM_ARC=https://github.com/redmine/redmine/archive/${RM_VER}.tar.gz
PATH=/usr/local/bin:${PATH}
# include functions
source inst-script/functions
# check memory size
source inst-script/check-mem
# check user
source inst-script/check-user
# check old alminium existance
source inst-script/check-old-alm
# OSを確認
source inst-script/check-os
# gitコマンドをチェック
source inst-script/check-git
# 各種設定
source inst-script/config-alminium
# 一時データ保存場所確保
mkdir -p ${ALM_SRC_DIR}/cache
# update submodules
if [ $(git config -l | egrep 'submodule.+url=' | wc -l) -ne \
$(grep submodule .gitmodules | wc -l) ]; then
git submodule init
fi
git submodule sync
git submodule update
# select db
source inst-script/select-db
# pre install
source inst-script/pre-install
# setup apache
source inst-script/config-apache
# install Redmine
source inst-script/install-redmine
# post install
echo "*** run post-install script ***"
source inst-script/post-install
# setup for SUBDIRECTORY
if [ "${ALM_SUBDIR}" != "" ]; then
ln -sf ${ALM_INSTALL_DIR}/public /var/www/html${ALM_SUBDIR}
echo ${ALM_SUBDIR} > ${ALM_INSTALL_DIR}/subdirname
fi
# プロジェクト作成時に自動的にリポジトリを作成するときに利用
#CHK=`egrep "reposman" /var/spool/cron/root`
#if [ "$CHK" = '' ]; then
# echo "* * * * * /opt/alminium/extra/svn/reposman.rb -g apache -o apache -s /var/opt/alminium/git -u /var/opt/alminium/git -r localhost --scm git" >> /var/spool/cron/root
#fi
# 定期バックアップ設定
if [ "${ALM_ENABLE_AUTO_BACKUP}" = "y" ]; then
source inst-script/config-backup
fi
# setup for jenkins
if [ "${ALM_ENABLE_JENKINS}" = "y" ]; then
source inst-script/install-jenkins
fi
# config log directories
source inst-script/config-logs
# smelt completed
if [ "${ALM_UPGRADE}" != "y" ]; then
echo ""
echo "ALMiniumのインストールが終了しました。ブラウザーで、"
echo "http://${ALM_HOSTNAME}${ALM_SUBDIR}"
echo "をアクセスしてください。"
echo "10秒程度の初期化が行われた後、最初の画面が表示されます。"
fi