From 9eb566571ccca12dd787515ab8934485c99ad26c Mon Sep 17 00:00:00 2001 From: ayapapa Date: Sun, 10 Feb 2019 12:59:51 +0900 Subject: [PATCH 1/2] fixed issue #128 --- inst-script/gems | 13 ++++++++++--- inst-script/install-redmine | 4 ++-- inst-script/post-install | 6 +++--- inst-script/rubygems.lst | 2 +- redmine/setup/install-plugins-jenkins | 4 ++-- redmine/setup/setup-db | 16 ++++++++-------- restore | 8 ++++---- 7 files changed, 30 insertions(+), 23 deletions(-) diff --git a/inst-script/gems b/inst-script/gems index 83260d94..789f4671 100755 --- a/inst-script/gems +++ b/inst-script/gems @@ -16,7 +16,8 @@ then gem update --system 2.7.4 fi -# インストールするディレクトリ名 +# あらかじめインストールしておくrubygems +BUNDLER=bundle NAME=(`grep -v "^#" inst-script/rubygems.lst | awk -F, '{print $1}'`) VER=(`grep -v "^#" inst-script/rubygems.lst | awk -F, '{print $2}'`) @@ -24,10 +25,16 @@ for (( i = 0; i < ${#NAME[@]}; ++i )) do NAME=${NAME[$i]} VER=${VER[$i]} + echo "**** install ${NAME} (ver. = ${VER}) ****" if [ "${VER}" = "-" ] then - ${GEM} install -f ${NAME} --no-rdoc --no-ri + ${GEM} install -f ${NAME} --no-document else - ${GEM} install -f ${NAME} -v=${VER} --no-rdoc --no-ri + ${GEM} install -f ${NAME} -v=${VER} --no-document + # issue #128対応:特定バージョンのbundlerが必要。 + if [ "${NAME}" = "bundler" ] + then + BUNDLER="bundle _${VER}_" + fi fi done diff --git a/inst-script/install-redmine b/inst-script/install-redmine index f4c566b6..c44ee966 100755 --- a/inst-script/install-redmine +++ b/inst-script/install-redmine @@ -65,7 +65,7 @@ install_gems() { fi # redmineに必要なgemをインストール - bundle install --path vendor/bundle \ + ${BUNDLER} install --path vendor/bundle \ --without development test postgresql sqlite xapian popd } @@ -73,7 +73,7 @@ install_gems() { # create secret token create_redmine_token() { pushd ${ALM_INSTALL_DIR} - bundle exec rake generate_secret_token + ${BUNDLER} exec rake generate_secret_token popd } diff --git a/inst-script/post-install b/inst-script/post-install index 239b3573..a4256f48 100755 --- a/inst-script/post-install +++ b/inst-script/post-install @@ -38,11 +38,11 @@ else # installed from gem. so configure with bundle exec i # passenger-install-apache2-module pushd ${ALM_INSTALL_DIR} - bundle exec passenger-install-apache2-module --snippet > ${ALM_ETC_DIR}/passenger.conf + ${BUNDLER} exec passenger-install-apache2-module --snippet > ${ALM_ETC_DIR}/passenger.conf if [ `echo ${OS} | grep rhel` != "" ]; then - bundle exec passenger-install-apache2-module --auto + ${BUNDLER} exec passenger-install-apache2-module --auto else - bundle exec passenger-install-apache2-module --auto --apxs2-path='/usr/bin/apxs' + ${BUNDLER} exec passenger-install-apache2-module --auto --apxs2-path='/usr/bin/apxs' fi popd ln -sf "${ALM_ETC_DIR}/passenger.conf" "${APACHE_CONF_DIR}/" diff --git a/inst-script/rubygems.lst b/inst-script/rubygems.lst index ec247a04..5fa53719 100644 --- a/inst-script/rubygems.lst +++ b/inst-script/rubygems.lst @@ -1,4 +1,4 @@ # for redmine -bundler,- +bundler,1.17.3 rake,- rake-compiler,- diff --git a/redmine/setup/install-plugins-jenkins b/redmine/setup/install-plugins-jenkins index b1293401..801a80d2 100755 --- a/redmine/setup/install-plugins-jenkins +++ b/redmine/setup/install-plugins-jenkins @@ -24,9 +24,9 @@ if [ "${ALM_DB_SETUP}" = "y" ]; then # install gems and migrate database cd .. - bundle install --path vendor/bundle \ + ${BUNDLER} install --path vendor/bundle \ --without development test postgresql sqlite xapian - bundle exec rake redmine:plugins:migrate \ + ${BUNDLER} exec rake redmine:plugins:migrate \ RAILS_ENV=production NAME=redmine_jenkins fi diff --git a/redmine/setup/setup-db b/redmine/setup/setup-db index faa0e3a6..e4f604dc 100755 --- a/redmine/setup/setup-db +++ b/redmine/setup/setup-db @@ -8,34 +8,34 @@ echo "*** run initialize DB ***" pushd ${ALM_INSTALL_DIR} # データベースにテーブルを作成 -bundle exec rake db:migrate RAILS_ENV=production +${BUNDLER} exec rake db:migrate RAILS_ENV=production # データベースにデフォルトデータを登録 echo 'ja' |\ -bundle exec rake redmine:load_default_data RAILS_ENV=production +${BUNDLER} exec rake redmine:load_default_data RAILS_ENV=production # プラグインをデータベースに登録 -bundle exec rake redmine:plugins:migrate RAILS_ENV=production +${BUNDLER} exec rake redmine:plugins:migrate RAILS_ENV=production # for XLS export if [ -d plugins/redmine_xls_export ]; then - bundle exec rake redmine:plugins:process_version_change RAILS_ENV=production + ${BUNDLER} exec rake redmine:plugins:process_version_change RAILS_ENV=production fi # for backlogs if [ -d plugins/redmine_backlogs ]; then if [ "$(db_setupped)" = "" ]; then - bundle exec rake redmine:backlogs:install task_tracker=サポート \ + ${BUNDLER} exec rake redmine:backlogs:install task_tracker=サポート \ story_trackers=機能 labels=false RAILS_ENV=production else - bundle exec rake redmine:backlogs:install task_tracker=タスク \ + ${BUNDLER} exec rake redmine:backlogs:install task_tracker=タスク \ story_trackers=機能 labels=false RAILS_ENV=production fi fi # キャッシュクリア -bundle exec rake tmp:cache:clear RAILS_ENV=production -bundle exec rake tmp:sessions:clear RAILS_ENV=production +${BUNDLER} exec rake tmp:cache:clear RAILS_ENV=production +${BUNDLER} exec rake tmp:sessions:clear RAILS_ENV=production # DB Customize if [ "$(db_setupped)" = "" ]; then diff --git a/restore b/restore index 4c5939b3..4c5e0496 100755 --- a/restore +++ b/restore @@ -57,10 +57,10 @@ if [ "${ALM_DB_RESTORE}" != "no" ]; then #データベースのマイグレーション echo "データベースのマイグレーションを実施します。" cd ${ALM_INSTALL_DIR} - bundle exec rake db:migrate RAILS_ENV=production - bundle exec rake redmine:plugins:migrate RAILS_ENV=production - bundle exec rake tmp:cache:clear RAILS_ENV=production - bundle exec rake tmp:sessions:clear RAILS_ENV=production + ${BUNDLER} exec rake db:migrate RAILS_ENV=production + ${BUNDLER} exec rake redmine:plugins:migrate RAILS_ENV=production + ${BUNDLER} exec rake tmp:cache:clear RAILS_ENV=production + ${BUNDLER} exec rake tmp:sessions:clear RAILS_ENV=production echo "データベースのマイグレーションが完了しました。" fi From 4064bb7e50a87aa977c6309f6853bf7a53394bbb Mon Sep 17 00:00:00 2001 From: ayapapa Date: Mon, 11 Feb 2019 06:42:01 +0900 Subject: [PATCH 2/2] fixed typo. --- inst-script/post-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst-script/post-install b/inst-script/post-install index a4256f48..5e7c945a 100755 --- a/inst-script/post-install +++ b/inst-script/post-install @@ -39,7 +39,7 @@ else # passenger-install-apache2-module pushd ${ALM_INSTALL_DIR} ${BUNDLER} exec passenger-install-apache2-module --snippet > ${ALM_ETC_DIR}/passenger.conf - if [ `echo ${OS} | grep rhel` != "" ]; then + if [ "`echo ${OS} | grep rhel`" != "" ]; then ${BUNDLER} exec passenger-install-apache2-module --auto else ${BUNDLER} exec passenger-install-apache2-module --auto --apxs2-path='/usr/bin/apxs'