毎回同じことやっているので、スクリプト化。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This script is deployed as /var/lib/rails/update_redmine.sh | |
if [ $# -eq 0 ]; then | |
echo Enter Redmine version. | |
exit 1 | |
fi | |
REDMINE_VERSION=$1 | |
export RAILS_ENV=production | |
echo "### Start update Redmine to ${REDMINE_VERSION}" | |
echo "### Download archive" | |
wget http://www.redmine.org/releases/redmine-${REDMINE_VERSION}.tar.gz | |
echo "### Extract downloaded file" | |
tar xf redmine-${REDMINE_VERSION}.tar.gz | |
echo "### Copy config files" | |
cp redmine/config/database.yml redmine-${REDMINE_VERSION}/config/ | |
cp redmine/config/configuration.yml redmine-${REDMINE_VERSION}/config/ | |
echo "### Copy installed plugins" | |
cp -r redmine/plugins/* redmine-${REDMINE_VERSION}/plugins/ | |
echo "### Execute bundle install" | |
cd redmine-${REDMINE_VERSION} | |
bundle install --path vendor/bundle --without development test | |
echo "### Setup Redmine" | |
bundle exec rake generate_secret_token | |
bundle exec rake db:migrate | |
bundle exec rake tmp:cache:clear | |
bundle exec rake tmp:sessions:clear | |
mkdir public/plugin_assets | |
echo "### Change owner" | |
cd ../ | |
chown -R www-data:www-data redmine-${REDMINE_VERSION} | |
echo "### Override current version" | |
ln -sfn /var/lib/rails/redmine-${REDMINE_VERSION} /var/lib/rails/redmine | |
echo "### Restart" | |
touch redmine/tmp/restart.txt | |
echo "### Remove downloaded file" | |
rm redmine-${REDMINE_VERSION}.tar.gz | |
echo "### Finish update Redmine" |
余程の大きく破壊的なバージョンアップでない限りコレで行けるはず。
せっかくなので、新機能のプラグインバージョンチェックを試してみると... むむむむ、調査せねば
0 件のコメント :
コメントを投稿