diff --git a/install/setup1.sh b/install/setup1.sh index 51d6c4b518..a99814ddb8 100644 --- a/install/setup1.sh +++ b/install/setup1.sh @@ -29,15 +29,10 @@ su - mastodon << EOF git clone https://github.com/rbenv/rbenv.git /home/mastodon/.rbenv cd /home/mastodon/.rbenv && src/configure && make -C src echo 'export PATH="/home/mastodon/.rbenv/bin:$PATH"' >> /home/mastodon/.bashrc -echo 'eval "$(rbenv init -)"' >> /home/mastodon/.bashrc +echo 'eval "\$(rbenv init -)"' >> /home/mastodon/.bashrc exec bash git clone https://github.com/rbenv/ruby-build.git /home/mastodon/.rbenv/plugins/ruby-build -RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 3.2.2 -rbenv global 3.2.2 - -gem install bundler --no-document - EOF sudo -u postgres psql << EOF @@ -50,9 +45,26 @@ git clone https://github.com/kmycode/mastodon.git live && cd live git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1) yarn install --pure-lockfile +chmod 0777 install/setup2.sh +chmod 0777 install/update.sh + +ln -s install/setup2.sh /home/mastodon/setup2 +ln -s install/update.sh /home/mastodon/update EOF +chmod o+x /home/mastodon cp /home/mastodon/live/dist/nginx.conf /etc/nginx/sites-available/mastodon ln -s /etc/nginx/sites-available/mastodon /etc/nginx/sites-enabled/mastodon cp /home/mastodon/live/dist/mastodon-*.service /etc/systemd/system/ systemctl daemon-reload + +echo << EOF + +============== [kmyblue setup script 1 completed] ================ + +Input this command to continue setup: + sudo su - mastodon + cd live + install/setup2.sh + +EOF diff --git a/install/setup2.sh b/install/setup2.sh index e69de29bb2..64a612fe87 100644 --- a/install/setup2.sh +++ b/install/setup2.sh @@ -0,0 +1,34 @@ +RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 3.2.2 +rbenv global 3.2.2 + +gem install bundler --no-document + +bundle config deployment 'true' +bundle config without 'development test' +bundle install -j$(getconf _NPROCESSORS_ONLN) + +unlink /home/mastodon/setup2 + +echo << EOF + +============== [kmyblue setup script 2 completed] ================ + +Input this command to finish setup: + RAILS_ENV=production bundle exec rake mastodon:setup + +If you update kmyblue version, use following: + /home/mastodon/update + +EOF + + +# パスワード変更 +# sudo -u postgres psql << EOF +# ALTER USER mastodon WITH PASSWORD 'ohagi'; +# EOF + +# サーバー設定変更 +# sudo vi /etc/nginx/sites-available/mastodon + +# サーバー起動・OS起動時自動起動設定 +# systemctl enable --now mastodon-web mastodon-sidekiq mastodon-streaming diff --git a/install/update.sh b/install/update.sh new file mode 100644 index 0000000000..722d6d35f3 --- /dev/null +++ b/install/update.sh @@ -0,0 +1,4 @@ +git stash + +git fetch +git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)