Heroku入門
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
#contents
** 概要 [#t74fcab8]
- Herokuとはなにか?
-- アプリケーションを稼働させるためのプラットフォーム
-- PaaS (Platform as a Service)
-- 公式サイト: https://www.heroku.com/
- サポート言語 (2017年8月現在)
-- Node.js / Ruby / Java / PHP / Python / Go / Scala / Cl...
- 前提条件 / 知識
-- Heroku無償アカウント登録済み
-- Ruby on Rails / Ruby
-- Unixコマンド / Vim
-- Git
-- PostgreSQL
- ローカル開発環境
-- OS X 10.11 El Capitan
-- VirtualBox 5.0.20
-- Vagrant 1.9.7
-- Ubuntu 16.04 (LTS)
-- Git 2.7.4
-- Ruby 2.4.1
-- Rails 5.1.3
-- PostgreSQL 9.6.3
** ローカル開発環境の構築 [#z2e0b481]
*** Vagrant初期設定 [#o1b0eb27]
- Ubuntu 16.04 (64bit) のbox (テンプレート) を追加
$ vagrant box add Ubuntu16.04 https://cloud-images.ubunt...
- Vagrant用ディレクトリ作成
$ mkdir heroku_lessons
$ cd heroku_lessons
- Vagrantの初期化
$ vagrant init Ubuntu16.04
- ネットワークアダプター設定
$ vi Vagrantfile
--------------------
config.vm.network "private_network", ip: "192.168.78.90"
--------------------
- Vagrant起動
$ vagrant up
- SSH接続確認
$ vagrant ssh
- apt-getアップデート
$ sudo apt-get update
*** Gitインストール [#lecd194a]
- gitインストール
$ sudo apt-get install git
$ git --version
git version 2.7.4
- git初期設定 (Global)
$ git config --global user.name "Yuji Shimojo"
$ git config --global user.email "y.shimojo@example.com"
$ git config --global color.ui true
*** Rubyインストール [#z81b25ce]
- 事前に必要なパッケージをインストール
$ sudo apt-get install git-core curl zlib1g-dev build-es...
// - ruby-build / ruby-devインストール
//
// $ sudo apt-get install -y ruby-build ruby-dev
- rbenvインストール
$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
- rbenv初期化
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
$ exec $SHELL
- ruby-buildインストール
$ git clone https://github.com/rbenv/ruby-build.git ~/.r...
$ echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin...
$ exec $SHELL
- 確認
$ echo "${PATH}"
/home/ubuntu/.rbenv/plugins/ruby-build/bin:/home/ubuntu/...
- インストール可能なRubyバージョン一覧表示
$ rbenv install --list
- 最新安定板のCRuby (2.4.1) インストール
$ sudo rbenv install 2.4.1
- Rubyの構成をアクティベート
$ sudo rbenv global 2.4.1
- システムで使用しているrbenvバージョン確認
$ rbenv global
2.4.1
- 各バージョン確認
$ rbenv version
2.4.1 (set by /home/ubuntu/.rbenv/version)
$ ruby --version
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
$ gem --version
2.6.11
- Gem構成の確認
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.6.11
- RUBY VERSION: 2.4.1 (2017-03-22 patchlevel 111) [x86...
- INSTALLATION DIRECTORY: /home/ubuntu/.rbenv/versions...
- USER INSTALLATION DIRECTORY: /home/ubuntu/.gem/ruby/...
- RUBY EXECUTABLE: /home/ubuntu/.rbenv/versions/2.4.1/...
- EXECUTABLE DIRECTORY: /home/ubuntu/.rbenv/versions/2...
- SPEC CACHE DIRECTORY: /home/ubuntu/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /home/ubuntu/.rbenv/...
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/ubuntu/.rbenv/versions/2.4.1/lib/ruby/gems/...
- /home/ubuntu/.gem/ruby/2.4.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-rdoc --no-ri"
- "update" => "--no-rdoc --no-ri"
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /home/ubuntu/.rbenv/versions/2.4.1/bin
- /home/ubuntu/.rbenv/libexec
- /home/ubuntu/.rbenv/plugins/ruby-build/bin
- /home/ubuntu/bin
- /home/ubuntu/.local/bin
- /home/ubuntu/.rbenv/plugins/ruby-build/bin
- /home/ubuntu/.rbenv/shims
- /home/ubuntu/.rbenv/bin
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- /usr/games
- /usr/local/games
- /snap/bin
- rbenvをリハッシュ
$ rbenv rehash
- rbenvリハッシュの自動化 (rbenv-rehash gemのインストール)
$ sudo gem i rbenv-rehash
*** Ruby on Railsインストール [#x5bb7495]
- 依存解決のためのNode.jsをインストール
$ curl -sL https://deb.nodesource.com/setup_4.x | sudo -...
$ sudo apt-get install -y nodejs
- gemが自動生成するri docドキュメントの無効化
$ echo 'install: --no-rdoc --no-ri' >> ~/.gemrc
$ echo 'update: --no-rdoc --no-ri' >> ~/.gemrc
- インストール可能なRailsバージョン一覧表示
$ gem query -ra -n "^rails$"
- 最新版のRails 5.1.3をインストール
$ sudo gem install rails -v 5.1.3
- Railsバージョン確認
$ rails -v
Rails 5.1.3
*** PostgreSQLインストール [#u37e62d3]
- 公式リポジトリ追加
$ sudo sh -c "echo 'deb http://apt.postgresql.org/pub/re...
$ wget --quiet -O - http://apt.postgresql.org/pub/repos/...
$ sudo apt-get update
- 最新版のPostgreSQL 9.6インストール
$ sudo apt-get install -y postgresql-common
$ sudo apt-get install -y postgresql-9.6 libpq-dev
- PostgreSQLバージョン確認
$ psql --version
psql (PostgreSQL) 9.6.3
- DB接続確認 &color(red){※}; エラー発生
$ psql -l
psql: could not connect to server: No such file or direc...
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/...
- Postgres設定ファイル編集
$ sudo vi /etc/postgresql/9.6/main/postgresql.conf
listen_addresses = 'localhost'
- DBユーザー作成
$ sudo -u postgres createuser ubuntu -s
$ sudo systemctl restart postgresql
$ psql -l
List of databases
Name | Owner | Encoding | Collate | Ctyp...
-----------+----------+----------+-------------+--------...
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.U...
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.U...
| | | | ...
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.U...
| | | | ...
** PaaS (Heroku) の仕組みを知ろう [#m15462e6]
- IaaS
-- Local Env: Ruby/Rails, Database, Web Server, Source Code
-- Server: Ruby/Rails, Database, Web Server, Source Code,...
- Heroku (PaaS)
-- Source Code
-- Dependencies: ライブラリの依存関係を示したファイル (Ru...
-- Procfile: Heroku上で動かしたいコマンド一覧
-- Slug: Source CodeとDependenciesをまとめたファイル
-- Dyno: Linuxコンテナ (Slugを読み込んで稼働, 容易に起動/...
-- Addon: 本番環境に必要なツールを提供 (Addon:Logging, Ad...
- Herokuの制約
-- Dyno上のディスク領域は揮発性のため永続データはAddon:Da...
-- Slugにもサイズ制限があるためJS, CSS, Images等は外部ス...
-- 基本機能の利用は無料だがDynoにアクセスが一定期間無いと...
** Heroku CLIインストール [#p95dd0ee]
- Debian/Ubuntu用の公式インストールシェルスクリプトをダウ...
$ wget -qO- https://cli-assets.heroku.com/install-ubuntu...
- Herokuバージョン確認
$ heroku --version
heroku-cli/6.13.7 (linux-x64) node-v8.2.1
- &color(red){※}; OS X (Elcapitan) 上にインストールする場...
- Homebrewアップデート
$ brew upgrade
$ brew update
- Heroku (Heroku CLI) インストール
$ brew install heroku
- Herokuバージョン確認
$ heroku --version
heroku-cli/6.13.7 (darwin-x64) node-v8.2.1
- 秘密鍵/公開鍵作成
$ ssh-keygen -t rsa -C y.shimojo@example.com
Generating public/private rsa key pair.
Enter file in which to save the key (/home/ubuntu/.ssh/i...
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/ubuntu/.ssh/...
Your public key has been saved in /home/ubuntu/.ssh/id_h...
- Herokuアカウントとの紐付け (heroku login)
$ heroku login
Enter your Heroku credentials:
Email: y.shimojo@example.com
Password: ********
Logged in as y.shimojo@example.com
- 公開鍵の登録 (アップロード)
$ heroku keys:add /home/ubuntu/.ssh/id_heroku_rsa.pub
Uploading /home/ubuntu/.ssh/id_heroku_rsa.pub SSH key......
** Railsアプリケーションを作ろう [#sa73c6ca]
- rails newでmymemoアプリ作成 (postgres使用)
$ rails new mymemo -d postgresql
- Gemfile編集
$ cd mymemo
$ vi Gemfile
gem 'therubyracer', platforms: :ruby
- Rails Server起動 &color(red){※}; エラー発生
$ rails s
Could not find gem 'therubyracer' in any of the gem sour...
Run `bundle install` to install missing gems.
- Bundlerをインストール &color(red){※}; --no-document オ...
$ sudo gem install bundler --no-document
- Gemの依存性解決 (bundle install)
$ bundle install
- Rails Server起動 (再実行)
$ rails s
=> Booting Puma
=> Rails 5.0.5 application starting in development on ht...
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.9.1 (ruby 2.3.1-p112), codename: Private Cal...
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
- ブラウザ経由で 192.168.78.90:3000 へ接続しRailsのデフォ...
- Scaffoldを使ってRailsアプリ作成 &color(red){※}; エラー...
$ rails g scaffold Memo title:string body:text
- 解決方法
$ sudo rbenv exec gem install bundler
$ rbenv rehash
$ bundle config build.nokogiri --with-xml2-config=/usr/l...
$ bundle config build.mini_portile2 --use-system-libraries
$ bundle install
$ rbenv rehash
- Scaffold再実行
$ rails g scaffold Memo title:string body:text
Running via Spring preloader in process 13342
invoke active_record
create db/migrate/20170806093511_create_memos.rb
create app/models/memo.rb
invoke test_unit
create test/models/memo_test.rb
create test/fixtures/memos.yml
invoke resource_route
route resources :memos
invoke scaffold_controller
create app/controllers/memos_controller.rb
invoke erb
create app/views/memos
create app/views/memos/index.html.erb
create app/views/memos/edit.html.erb
create app/views/memos/show.html.erb
create app/views/memos/new.html.erb
create app/views/memos/_form.html.erb
invoke test_unit
create test/controllers/memos_controller_test...
invoke helper
create app/helpers/memos_helper.rb
invoke test_unit
invoke jbuilder
create app/views/memos/index.json.jbuilder
create app/views/memos/show.json.jbuilder
create app/views/memos/_memo.json.jbuilder
invoke test_unit
create test/system/memos_test.rb
invoke assets
invoke coffee
create app/assets/javascripts/memos.coffee
invoke scss
create app/assets/stylesheets/memos.scss
invoke scss
create app/assets/stylesheets/scaffolds.scss
- データベース作成
$ bundle exec rake db:create
Created database 'mymemo_development'
Created database 'mymemo_test'
- テーブル作成
$ bundle exec rake db:migrate
== 20170806093511 CreateMemos: migrating ===============...
-- create_table(:memos)
-> 0.0051s
== 20170806093511 CreateMemos: migrated (0.0063s) ======...
- Rails Server起動
$ rails s
- ブラウザ経由で 192.168.78.90:3000/memos へ接続しCRUDア...
- 依存関係にあるGemをインストール
$ bundle install
- Git初期設定
$ pwd
/home/ubuntu/mymemo
$ git init
$ git add .
$ git commit -m "initial commit"
** heroku createしてみよう [#g4e5d129]
- Gemfile内にherokuで必要なgemを追記
$ vi Gemfile
gem 'rails_12factor', group: :production
- Procfileを作成
$ vi Procfile
web: bundle exec rails server -p $PORT
$ git add .
$ git commit -m "Gemfile updated, Procfile added"
- Herokuアプリを作成 (heroku createコマンドでgit remote r...
$ heroku create
Creating app... done, ⬢ tranquil-headland-xxxxx
https://tranquil-headland-90386.herokuapp.com/ | https:/...
** Heroku上で確認してみよう [#ec6631ab]
- Gitプッシュ
$ git push heroku master
- Heroku上にDB作成 (Addon利用)
$ heroku addons:add heroku-postgresql
Creating heroku-postgresql on ⬢ tranquil-headland...
Database has been created and is available
! This database is empty. If upgrading, you can transfer
! data from another database with pg:copy
Created postgresql-encircled-xxxxx as DATABASE_URL
Use heroku addons:docs heroku-postgresql to view documen...
- DBマイグレート
$ heroku run rake db:migrate
- Herokuアプリの情報表示 (URL等)
$ heroku apps:info
=== tranquil-headland-xxxxx
Addons: heroku-postgresql:hobby-dev
Auto Cert Mgmt: false
Dynos:
Git URL: https://git.heroku.com/tranquil-headland...
Owner: y.shimojo@example.com
Region: us
Repo Size: 0 B
Slug Size: 0 B
Stack: heroku-16
Web URL: https://tranquil-headland-xxxxx.herokuap...
- ブラウザ経由で https://tranquil-headland-xxxxx.herokuap...
- カレントディレクトリがHerokuアプリのローカルリポジトリ...
$ heroku apps:info
▸ No app specified.
▸ USAGE: heroku info my-app
$ cd mymemo/
$ heroku apps:info
- Herokuアプリの情報表示 (アプリ指定)
$ heroku apps:info --app tranquil-headland-xxxxx
- Herokuアプリ一覧表示
$ heroku list
=== y.shimojo@example.com Apps
tranquil-headland-xxxxx
- Herokuアプリ名を指定して情報表示 (heroku apps:info --ap...
$ heroku info tranquil-headland-xxxxx
=== tranquil-headland-xxxxx
Addons: heroku-postgresql:hobby-dev
Auto Cert Mgmt: false
Dynos: web: 1
Git URL: https://git.heroku.com/tranquil-headland...
Owner: y.shimojo@example.com
Region: us
Repo Size: 37 KB
Slug Size: 38 MB
Stack: heroku-16
Web URL: https://tranquil-headland-xxxxx.herokuap...
** heroku ps/logs/maintenanceを使おう [#e1c8f1ca]
- プロセス確認コマンド
$ heroku ps
Free dyno hours quota remaining this month: 550h 0m (100%)
For more information on dyno sleeping and how to upgrade...
https://devcenter.heroku.com/articles/dyno-sleeping
=== web (Free): bundle exec rails server -p $PORT (1)
web.1: up 2017/08/06 10:52:12 +0000 (~ 4m ago)
- Dynoの台数を変更するコマンド (1=>2) &color(red){※}; 有...
$ heroku ps:scale web=2
Scaling dynos... !
▸ Cannot update to more than 1 Free size dynos...
- ログ確認コマンド &color(red){※}; デフォルト1,500行まで...
$ heroku logs
- ログ確認コマンド (ストリーム表示)
$ heroku logs --tail
- メンテナンスモード切り替え
$ heroku maintenance:on
- メンテナンスモードの状態表示
$ heroku maintenance
on
- メンテナンスモード解除
$ heroku maintenance:off
** One-off Dynosを使ってみよう [#p4c14c8a]
- heroku runでDynoに対してコマンド実行する際に裏側ではOne...
- bashコマンド実行
$ heroku run bash
~ $ ls
app bin config config.ru db Gemfile Gemfile.lock l...
~ $ exit
exit
- rails consoleコマンド実行
$ heroku run rails console
irb(main):001:0> m = Memo.new({title:"hoge",body:"hogeho...
=> #<Memo id: nil, title: "hoge", body: "hogehoge", crea...
irb(main):002:0> m.save
(1.3ms) BEGIN
SQL (1.7ms) INSERT INTO "memos" ("title", "body", "cr...
(2.1ms) COMMIT
=> true
irb(main):003:0> auit
- ブラウザ経由でデータが追加されていることを確認
** heroku releasesを使ってみよう [#yf791370]
- index.html.erbに "hello world" 追記
$ vi app/views/memos/index.html.erb
<p>hello world</p>
- Rails Server起動しブラウザ経由 (192.168.78.90:3000/memo...
- Gitプッシュ
$ git add .
$ git commit -m "added hello world"
$ git push heroku master
- Gitプッシュの度に作成されるリリース履歴を確認
$ heroku releases
=== tranquil-headland-xxxxx Releases - Current: v6
v6 Deploy 24731a70 ...
v5 Deploy 80b93304 ...
v4 Set LANG, RACK_ENV, RAILS_ENV, RAILS_LOG_TO_STDOUT, ...
v3 Attach DATABASE (@ref:postgresql-encircled-86963) ...
v2 Enable Logplex ...
v1 Initial release ...
- ロールバック (バージョン指定も可)
$ heroku releases:rollback
** 環境変数を使ってみよう [#vc8f7599]
- APIキーやDBホストは環境変数にセットすることが推奨
- 環境変数のセット
$ heroku config:set mykey=value
- 環境変数の確認 (key指定)
$ heroku config:get mykey
- 環境変数の確認
$ heroku config
- 環境変数のアンセット
$ heroku config:unset mykey
- プログラム内から環境変数を参照
$ vi app/views/memos/index.html.erb
<p><%= ENV['mykey'] %></p>
- Gitプッシュ
$ git add .
$ git commit -m "mykey added"
$ git push heroku master
- ブラウザ経由でmykeyの値が表示されていることを確認
** foremanを使ってみよう [#e0822fe7]
- foremanインストール
$ sudo apt-get install ruby-foreman
- 環境変数をローカル環境でも参照する方法 (.envファイルを...
$ vi .env
mykey=mylocalvalue
- 実行の際は rails s ではなく foreman コマンドを使用 (ポ...
$ foreman start
- &color(red){※}; 未解決: ブラウザ経由で 192.168.78.90:50...
- ローカル環境用の環境変数をgit ignoreに追加
$ vi .gitignore
.env
- Heroku環境の環境変数は
-- Dashboard >> アプリ選択 >> Settings >> "Reveal Config ...
** Python 環境構築 [#gc05ec18]
- 参考URL: https://devcenter.heroku.com/articles/getting-...
*** ローカル開発環境の構築 [#x1fa6ffa]
- 必要 (不足) モジュールインストール
$ sudo apt-get install libbz2-dev llvm libncurses5-dev l...
- pyenv をクローン
$ git clone git://github.com/yyuu/pyenv.git ~/.pyenv
- virtual env をクローン
$ git clone https://github.com/yyuu/pyenv-virtualenv.git...
- bashrc 編集
$ vi ~/.bashrc
export PYENV_ROOT="${HOME}/.pyenv"
if [ -d "${PYENV_ROOT}" ]; then
export PATH=${PYENV_ROOT}/bin:$PATH
eval "$(pyenv init -)"
fi
$ source ~/.bashrc
- インストール可能な Python 3.6 バージョン確認
$ pyenv install -l | grep 3.6
3.3.6
3.6.0
3.6-dev
3.6.1
3.6.2
- Python 3.6.1 インストール
$ pyenv install 3.6.1
- Python バージョンのグローバル指定
$ pyenv global 3.6.1
$ python --version
Python 3.6.1
*** Heroku アプリ作成 / デプロイ [#o1fbbc18]
- サンプルアプリをクローン
$ git clone https://github.com/heroku/python-getting-sta...
$ cd python-getting-started
- アプリ作成 (heroku create)
$ heroku create
Creating app... done, ⬢ lit-shelf-xxxxx
https://lit-shelf-xxxxx.herokuapp.com/ | https://git.her...
- デプロイ (git push)
$ git push heroku master
Counting objects: 328, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (146/146), done.
Writing objects: 100% (328/328), 50.90 KiB | 0 bytes/s, ...
Total 328 (delta 160), reused 328 (delta 160)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.6.2
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote: Collecting dj-database-url==0.4.1 (from -...
remote: Downloading dj-database-url-0.4.1.tar.gz
remote: Collecting Django==1.11 (from -r /tmp/bui...
remote: Downloading Django-1.11-py2.py3-none-an...
remote: Collecting gunicorn==19.6.0 (from -r /tmp...
remote: Downloading gunicorn-19.6.0-py2.py3-non...
remote: Collecting psycopg2==2.6.2 (from -r /tmp/...
remote: Downloading psycopg2-2.6.2.tar.gz (376kB)
remote: Collecting whitenoise==3.3.0 (from -r /tm...
remote: Downloading whitenoise-3.3.0-py2.py3-no...
remote: Collecting pytz (from Django==1.11->-r /t...
remote: Downloading pytz-2017.2-py2.py3-none-an...
remote: Installing collected packages: dj-databas...
remote: Running setup.py install for dj-databas...
remote: Running setup.py install for dj-datab...
remote: Running setup.py install for psycopg2: ...
remote: Running setup.py install for psycopg2...
remote: Successfully installed Django-1.11 dj-dat...
remote:
remote: -----> $ python manage.py collectstatic --noinput
remote: 63 static files copied to '/tmp/build_bb2...
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 49.1M
remote: -----> Launching...
remote: Released v4
remote: https://lit-shelf-xxxxx.herokuapp.com/ de...
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/lit-shelf-xxxxx.git
* [new branch] master -> master
- アプリケーションのプロセス起動
$ heroku ps:scale web=1
- 状態確認
$ heroku ps
- ブラウザ経由で https://lit-shelf-xxxxx.herokuapp.com/ ...
- ログ確認
$ heroku logs --tail
- Procfile 確認
$ view Procfile
- requirements.txt 確認 (依存関係のあるライブラリ管理)
$ cat requirements.txt
dj-database-url==0.4.1
Django==1.11
gunicorn==19.6.0
psycopg2==2.6.2
whitenoise==3.3.0
- ローカル仮想環境に requirements.txt をインストール &col...
$ python -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
- ローカル仮想環境の無効化
$ deactivate
- ローカル環境 (venv環境下) でサーバー起動
$ python manage.py collectstatic
$ heroku local web
[OKAY] Loaded ENV .env File as KEY=VALUE Format
12:55:24 web.1 | [2017-08-20 12:55:24 +0000] [12622] ...
12:55:24 web.1 | [2017-08-20 12:55:24 +0000] [12622] ...
12:55:24 web.1 | [2017-08-20 12:55:24 +0000] [12622] ...
12:55:24 web.1 | [2017-08-20 12:55:24 +0000] [12625] ...
12:55:32 web.1 | Not Found: /favicon.ico
- ブラウザ経由で 192.168.78.90:5000 へアクセスし確認
*** Heroku アプリ削除 [#d2f49a4b]
$ heroku destroy
▸ WARNING: This will delete ⬢ lit-shelf...
▸ To proceed, type lit-shelf-xxxxx or re-run t...
> lit-shelf-xxxxx
Destroying ⬢ lit-shelf-xxxxx (including all add-o...
終了行:
#contents
** 概要 [#t74fcab8]
- Herokuとはなにか?
-- アプリケーションを稼働させるためのプラットフォーム
-- PaaS (Platform as a Service)
-- 公式サイト: https://www.heroku.com/
- サポート言語 (2017年8月現在)
-- Node.js / Ruby / Java / PHP / Python / Go / Scala / Cl...
- 前提条件 / 知識
-- Heroku無償アカウント登録済み
-- Ruby on Rails / Ruby
-- Unixコマンド / Vim
-- Git
-- PostgreSQL
- ローカル開発環境
-- OS X 10.11 El Capitan
-- VirtualBox 5.0.20
-- Vagrant 1.9.7
-- Ubuntu 16.04 (LTS)
-- Git 2.7.4
-- Ruby 2.4.1
-- Rails 5.1.3
-- PostgreSQL 9.6.3
** ローカル開発環境の構築 [#z2e0b481]
*** Vagrant初期設定 [#o1b0eb27]
- Ubuntu 16.04 (64bit) のbox (テンプレート) を追加
$ vagrant box add Ubuntu16.04 https://cloud-images.ubunt...
- Vagrant用ディレクトリ作成
$ mkdir heroku_lessons
$ cd heroku_lessons
- Vagrantの初期化
$ vagrant init Ubuntu16.04
- ネットワークアダプター設定
$ vi Vagrantfile
--------------------
config.vm.network "private_network", ip: "192.168.78.90"
--------------------
- Vagrant起動
$ vagrant up
- SSH接続確認
$ vagrant ssh
- apt-getアップデート
$ sudo apt-get update
*** Gitインストール [#lecd194a]
- gitインストール
$ sudo apt-get install git
$ git --version
git version 2.7.4
- git初期設定 (Global)
$ git config --global user.name "Yuji Shimojo"
$ git config --global user.email "y.shimojo@example.com"
$ git config --global color.ui true
*** Rubyインストール [#z81b25ce]
- 事前に必要なパッケージをインストール
$ sudo apt-get install git-core curl zlib1g-dev build-es...
// - ruby-build / ruby-devインストール
//
// $ sudo apt-get install -y ruby-build ruby-dev
- rbenvインストール
$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
- rbenv初期化
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
$ exec $SHELL
- ruby-buildインストール
$ git clone https://github.com/rbenv/ruby-build.git ~/.r...
$ echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin...
$ exec $SHELL
- 確認
$ echo "${PATH}"
/home/ubuntu/.rbenv/plugins/ruby-build/bin:/home/ubuntu/...
- インストール可能なRubyバージョン一覧表示
$ rbenv install --list
- 最新安定板のCRuby (2.4.1) インストール
$ sudo rbenv install 2.4.1
- Rubyの構成をアクティベート
$ sudo rbenv global 2.4.1
- システムで使用しているrbenvバージョン確認
$ rbenv global
2.4.1
- 各バージョン確認
$ rbenv version
2.4.1 (set by /home/ubuntu/.rbenv/version)
$ ruby --version
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
$ gem --version
2.6.11
- Gem構成の確認
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.6.11
- RUBY VERSION: 2.4.1 (2017-03-22 patchlevel 111) [x86...
- INSTALLATION DIRECTORY: /home/ubuntu/.rbenv/versions...
- USER INSTALLATION DIRECTORY: /home/ubuntu/.gem/ruby/...
- RUBY EXECUTABLE: /home/ubuntu/.rbenv/versions/2.4.1/...
- EXECUTABLE DIRECTORY: /home/ubuntu/.rbenv/versions/2...
- SPEC CACHE DIRECTORY: /home/ubuntu/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /home/ubuntu/.rbenv/...
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/ubuntu/.rbenv/versions/2.4.1/lib/ruby/gems/...
- /home/ubuntu/.gem/ruby/2.4.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-rdoc --no-ri"
- "update" => "--no-rdoc --no-ri"
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /home/ubuntu/.rbenv/versions/2.4.1/bin
- /home/ubuntu/.rbenv/libexec
- /home/ubuntu/.rbenv/plugins/ruby-build/bin
- /home/ubuntu/bin
- /home/ubuntu/.local/bin
- /home/ubuntu/.rbenv/plugins/ruby-build/bin
- /home/ubuntu/.rbenv/shims
- /home/ubuntu/.rbenv/bin
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- /usr/games
- /usr/local/games
- /snap/bin
- rbenvをリハッシュ
$ rbenv rehash
- rbenvリハッシュの自動化 (rbenv-rehash gemのインストール)
$ sudo gem i rbenv-rehash
*** Ruby on Railsインストール [#x5bb7495]
- 依存解決のためのNode.jsをインストール
$ curl -sL https://deb.nodesource.com/setup_4.x | sudo -...
$ sudo apt-get install -y nodejs
- gemが自動生成するri docドキュメントの無効化
$ echo 'install: --no-rdoc --no-ri' >> ~/.gemrc
$ echo 'update: --no-rdoc --no-ri' >> ~/.gemrc
- インストール可能なRailsバージョン一覧表示
$ gem query -ra -n "^rails$"
- 最新版のRails 5.1.3をインストール
$ sudo gem install rails -v 5.1.3
- Railsバージョン確認
$ rails -v
Rails 5.1.3
*** PostgreSQLインストール [#u37e62d3]
- 公式リポジトリ追加
$ sudo sh -c "echo 'deb http://apt.postgresql.org/pub/re...
$ wget --quiet -O - http://apt.postgresql.org/pub/repos/...
$ sudo apt-get update
- 最新版のPostgreSQL 9.6インストール
$ sudo apt-get install -y postgresql-common
$ sudo apt-get install -y postgresql-9.6 libpq-dev
- PostgreSQLバージョン確認
$ psql --version
psql (PostgreSQL) 9.6.3
- DB接続確認 &color(red){※}; エラー発生
$ psql -l
psql: could not connect to server: No such file or direc...
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/...
- Postgres設定ファイル編集
$ sudo vi /etc/postgresql/9.6/main/postgresql.conf
listen_addresses = 'localhost'
- DBユーザー作成
$ sudo -u postgres createuser ubuntu -s
$ sudo systemctl restart postgresql
$ psql -l
List of databases
Name | Owner | Encoding | Collate | Ctyp...
-----------+----------+----------+-------------+--------...
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.U...
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.U...
| | | | ...
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.U...
| | | | ...
** PaaS (Heroku) の仕組みを知ろう [#m15462e6]
- IaaS
-- Local Env: Ruby/Rails, Database, Web Server, Source Code
-- Server: Ruby/Rails, Database, Web Server, Source Code,...
- Heroku (PaaS)
-- Source Code
-- Dependencies: ライブラリの依存関係を示したファイル (Ru...
-- Procfile: Heroku上で動かしたいコマンド一覧
-- Slug: Source CodeとDependenciesをまとめたファイル
-- Dyno: Linuxコンテナ (Slugを読み込んで稼働, 容易に起動/...
-- Addon: 本番環境に必要なツールを提供 (Addon:Logging, Ad...
- Herokuの制約
-- Dyno上のディスク領域は揮発性のため永続データはAddon:Da...
-- Slugにもサイズ制限があるためJS, CSS, Images等は外部ス...
-- 基本機能の利用は無料だがDynoにアクセスが一定期間無いと...
** Heroku CLIインストール [#p95dd0ee]
- Debian/Ubuntu用の公式インストールシェルスクリプトをダウ...
$ wget -qO- https://cli-assets.heroku.com/install-ubuntu...
- Herokuバージョン確認
$ heroku --version
heroku-cli/6.13.7 (linux-x64) node-v8.2.1
- &color(red){※}; OS X (Elcapitan) 上にインストールする場...
- Homebrewアップデート
$ brew upgrade
$ brew update
- Heroku (Heroku CLI) インストール
$ brew install heroku
- Herokuバージョン確認
$ heroku --version
heroku-cli/6.13.7 (darwin-x64) node-v8.2.1
- 秘密鍵/公開鍵作成
$ ssh-keygen -t rsa -C y.shimojo@example.com
Generating public/private rsa key pair.
Enter file in which to save the key (/home/ubuntu/.ssh/i...
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/ubuntu/.ssh/...
Your public key has been saved in /home/ubuntu/.ssh/id_h...
- Herokuアカウントとの紐付け (heroku login)
$ heroku login
Enter your Heroku credentials:
Email: y.shimojo@example.com
Password: ********
Logged in as y.shimojo@example.com
- 公開鍵の登録 (アップロード)
$ heroku keys:add /home/ubuntu/.ssh/id_heroku_rsa.pub
Uploading /home/ubuntu/.ssh/id_heroku_rsa.pub SSH key......
** Railsアプリケーションを作ろう [#sa73c6ca]
- rails newでmymemoアプリ作成 (postgres使用)
$ rails new mymemo -d postgresql
- Gemfile編集
$ cd mymemo
$ vi Gemfile
gem 'therubyracer', platforms: :ruby
- Rails Server起動 &color(red){※}; エラー発生
$ rails s
Could not find gem 'therubyracer' in any of the gem sour...
Run `bundle install` to install missing gems.
- Bundlerをインストール &color(red){※}; --no-document オ...
$ sudo gem install bundler --no-document
- Gemの依存性解決 (bundle install)
$ bundle install
- Rails Server起動 (再実行)
$ rails s
=> Booting Puma
=> Rails 5.0.5 application starting in development on ht...
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.9.1 (ruby 2.3.1-p112), codename: Private Cal...
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
- ブラウザ経由で 192.168.78.90:3000 へ接続しRailsのデフォ...
- Scaffoldを使ってRailsアプリ作成 &color(red){※}; エラー...
$ rails g scaffold Memo title:string body:text
- 解決方法
$ sudo rbenv exec gem install bundler
$ rbenv rehash
$ bundle config build.nokogiri --with-xml2-config=/usr/l...
$ bundle config build.mini_portile2 --use-system-libraries
$ bundle install
$ rbenv rehash
- Scaffold再実行
$ rails g scaffold Memo title:string body:text
Running via Spring preloader in process 13342
invoke active_record
create db/migrate/20170806093511_create_memos.rb
create app/models/memo.rb
invoke test_unit
create test/models/memo_test.rb
create test/fixtures/memos.yml
invoke resource_route
route resources :memos
invoke scaffold_controller
create app/controllers/memos_controller.rb
invoke erb
create app/views/memos
create app/views/memos/index.html.erb
create app/views/memos/edit.html.erb
create app/views/memos/show.html.erb
create app/views/memos/new.html.erb
create app/views/memos/_form.html.erb
invoke test_unit
create test/controllers/memos_controller_test...
invoke helper
create app/helpers/memos_helper.rb
invoke test_unit
invoke jbuilder
create app/views/memos/index.json.jbuilder
create app/views/memos/show.json.jbuilder
create app/views/memos/_memo.json.jbuilder
invoke test_unit
create test/system/memos_test.rb
invoke assets
invoke coffee
create app/assets/javascripts/memos.coffee
invoke scss
create app/assets/stylesheets/memos.scss
invoke scss
create app/assets/stylesheets/scaffolds.scss
- データベース作成
$ bundle exec rake db:create
Created database 'mymemo_development'
Created database 'mymemo_test'
- テーブル作成
$ bundle exec rake db:migrate
== 20170806093511 CreateMemos: migrating ===============...
-- create_table(:memos)
-> 0.0051s
== 20170806093511 CreateMemos: migrated (0.0063s) ======...
- Rails Server起動
$ rails s
- ブラウザ経由で 192.168.78.90:3000/memos へ接続しCRUDア...
- 依存関係にあるGemをインストール
$ bundle install
- Git初期設定
$ pwd
/home/ubuntu/mymemo
$ git init
$ git add .
$ git commit -m "initial commit"
** heroku createしてみよう [#g4e5d129]
- Gemfile内にherokuで必要なgemを追記
$ vi Gemfile
gem 'rails_12factor', group: :production
- Procfileを作成
$ vi Procfile
web: bundle exec rails server -p $PORT
$ git add .
$ git commit -m "Gemfile updated, Procfile added"
- Herokuアプリを作成 (heroku createコマンドでgit remote r...
$ heroku create
Creating app... done, ⬢ tranquil-headland-xxxxx
https://tranquil-headland-90386.herokuapp.com/ | https:/...
** Heroku上で確認してみよう [#ec6631ab]
- Gitプッシュ
$ git push heroku master
- Heroku上にDB作成 (Addon利用)
$ heroku addons:add heroku-postgresql
Creating heroku-postgresql on ⬢ tranquil-headland...
Database has been created and is available
! This database is empty. If upgrading, you can transfer
! data from another database with pg:copy
Created postgresql-encircled-xxxxx as DATABASE_URL
Use heroku addons:docs heroku-postgresql to view documen...
- DBマイグレート
$ heroku run rake db:migrate
- Herokuアプリの情報表示 (URL等)
$ heroku apps:info
=== tranquil-headland-xxxxx
Addons: heroku-postgresql:hobby-dev
Auto Cert Mgmt: false
Dynos:
Git URL: https://git.heroku.com/tranquil-headland...
Owner: y.shimojo@example.com
Region: us
Repo Size: 0 B
Slug Size: 0 B
Stack: heroku-16
Web URL: https://tranquil-headland-xxxxx.herokuap...
- ブラウザ経由で https://tranquil-headland-xxxxx.herokuap...
- カレントディレクトリがHerokuアプリのローカルリポジトリ...
$ heroku apps:info
▸ No app specified.
▸ USAGE: heroku info my-app
$ cd mymemo/
$ heroku apps:info
- Herokuアプリの情報表示 (アプリ指定)
$ heroku apps:info --app tranquil-headland-xxxxx
- Herokuアプリ一覧表示
$ heroku list
=== y.shimojo@example.com Apps
tranquil-headland-xxxxx
- Herokuアプリ名を指定して情報表示 (heroku apps:info --ap...
$ heroku info tranquil-headland-xxxxx
=== tranquil-headland-xxxxx
Addons: heroku-postgresql:hobby-dev
Auto Cert Mgmt: false
Dynos: web: 1
Git URL: https://git.heroku.com/tranquil-headland...
Owner: y.shimojo@example.com
Region: us
Repo Size: 37 KB
Slug Size: 38 MB
Stack: heroku-16
Web URL: https://tranquil-headland-xxxxx.herokuap...
** heroku ps/logs/maintenanceを使おう [#e1c8f1ca]
- プロセス確認コマンド
$ heroku ps
Free dyno hours quota remaining this month: 550h 0m (100%)
For more information on dyno sleeping and how to upgrade...
https://devcenter.heroku.com/articles/dyno-sleeping
=== web (Free): bundle exec rails server -p $PORT (1)
web.1: up 2017/08/06 10:52:12 +0000 (~ 4m ago)
- Dynoの台数を変更するコマンド (1=>2) &color(red){※}; 有...
$ heroku ps:scale web=2
Scaling dynos... !
▸ Cannot update to more than 1 Free size dynos...
- ログ確認コマンド &color(red){※}; デフォルト1,500行まで...
$ heroku logs
- ログ確認コマンド (ストリーム表示)
$ heroku logs --tail
- メンテナンスモード切り替え
$ heroku maintenance:on
- メンテナンスモードの状態表示
$ heroku maintenance
on
- メンテナンスモード解除
$ heroku maintenance:off
** One-off Dynosを使ってみよう [#p4c14c8a]
- heroku runでDynoに対してコマンド実行する際に裏側ではOne...
- bashコマンド実行
$ heroku run bash
~ $ ls
app bin config config.ru db Gemfile Gemfile.lock l...
~ $ exit
exit
- rails consoleコマンド実行
$ heroku run rails console
irb(main):001:0> m = Memo.new({title:"hoge",body:"hogeho...
=> #<Memo id: nil, title: "hoge", body: "hogehoge", crea...
irb(main):002:0> m.save
(1.3ms) BEGIN
SQL (1.7ms) INSERT INTO "memos" ("title", "body", "cr...
(2.1ms) COMMIT
=> true
irb(main):003:0> auit
- ブラウザ経由でデータが追加されていることを確認
** heroku releasesを使ってみよう [#yf791370]
- index.html.erbに "hello world" 追記
$ vi app/views/memos/index.html.erb
<p>hello world</p>
- Rails Server起動しブラウザ経由 (192.168.78.90:3000/memo...
- Gitプッシュ
$ git add .
$ git commit -m "added hello world"
$ git push heroku master
- Gitプッシュの度に作成されるリリース履歴を確認
$ heroku releases
=== tranquil-headland-xxxxx Releases - Current: v6
v6 Deploy 24731a70 ...
v5 Deploy 80b93304 ...
v4 Set LANG, RACK_ENV, RAILS_ENV, RAILS_LOG_TO_STDOUT, ...
v3 Attach DATABASE (@ref:postgresql-encircled-86963) ...
v2 Enable Logplex ...
v1 Initial release ...
- ロールバック (バージョン指定も可)
$ heroku releases:rollback
** 環境変数を使ってみよう [#vc8f7599]
- APIキーやDBホストは環境変数にセットすることが推奨
- 環境変数のセット
$ heroku config:set mykey=value
- 環境変数の確認 (key指定)
$ heroku config:get mykey
- 環境変数の確認
$ heroku config
- 環境変数のアンセット
$ heroku config:unset mykey
- プログラム内から環境変数を参照
$ vi app/views/memos/index.html.erb
<p><%= ENV['mykey'] %></p>
- Gitプッシュ
$ git add .
$ git commit -m "mykey added"
$ git push heroku master
- ブラウザ経由でmykeyの値が表示されていることを確認
** foremanを使ってみよう [#e0822fe7]
- foremanインストール
$ sudo apt-get install ruby-foreman
- 環境変数をローカル環境でも参照する方法 (.envファイルを...
$ vi .env
mykey=mylocalvalue
- 実行の際は rails s ではなく foreman コマンドを使用 (ポ...
$ foreman start
- &color(red){※}; 未解決: ブラウザ経由で 192.168.78.90:50...
- ローカル環境用の環境変数をgit ignoreに追加
$ vi .gitignore
.env
- Heroku環境の環境変数は
-- Dashboard >> アプリ選択 >> Settings >> "Reveal Config ...
** Python 環境構築 [#gc05ec18]
- 参考URL: https://devcenter.heroku.com/articles/getting-...
*** ローカル開発環境の構築 [#x1fa6ffa]
- 必要 (不足) モジュールインストール
$ sudo apt-get install libbz2-dev llvm libncurses5-dev l...
- pyenv をクローン
$ git clone git://github.com/yyuu/pyenv.git ~/.pyenv
- virtual env をクローン
$ git clone https://github.com/yyuu/pyenv-virtualenv.git...
- bashrc 編集
$ vi ~/.bashrc
export PYENV_ROOT="${HOME}/.pyenv"
if [ -d "${PYENV_ROOT}" ]; then
export PATH=${PYENV_ROOT}/bin:$PATH
eval "$(pyenv init -)"
fi
$ source ~/.bashrc
- インストール可能な Python 3.6 バージョン確認
$ pyenv install -l | grep 3.6
3.3.6
3.6.0
3.6-dev
3.6.1
3.6.2
- Python 3.6.1 インストール
$ pyenv install 3.6.1
- Python バージョンのグローバル指定
$ pyenv global 3.6.1
$ python --version
Python 3.6.1
*** Heroku アプリ作成 / デプロイ [#o1fbbc18]
- サンプルアプリをクローン
$ git clone https://github.com/heroku/python-getting-sta...
$ cd python-getting-started
- アプリ作成 (heroku create)
$ heroku create
Creating app... done, ⬢ lit-shelf-xxxxx
https://lit-shelf-xxxxx.herokuapp.com/ | https://git.her...
- デプロイ (git push)
$ git push heroku master
Counting objects: 328, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (146/146), done.
Writing objects: 100% (328/328), 50.90 KiB | 0 bytes/s, ...
Total 328 (delta 160), reused 328 (delta 160)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.6.2
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote: Collecting dj-database-url==0.4.1 (from -...
remote: Downloading dj-database-url-0.4.1.tar.gz
remote: Collecting Django==1.11 (from -r /tmp/bui...
remote: Downloading Django-1.11-py2.py3-none-an...
remote: Collecting gunicorn==19.6.0 (from -r /tmp...
remote: Downloading gunicorn-19.6.0-py2.py3-non...
remote: Collecting psycopg2==2.6.2 (from -r /tmp/...
remote: Downloading psycopg2-2.6.2.tar.gz (376kB)
remote: Collecting whitenoise==3.3.0 (from -r /tm...
remote: Downloading whitenoise-3.3.0-py2.py3-no...
remote: Collecting pytz (from Django==1.11->-r /t...
remote: Downloading pytz-2017.2-py2.py3-none-an...
remote: Installing collected packages: dj-databas...
remote: Running setup.py install for dj-databas...
remote: Running setup.py install for dj-datab...
remote: Running setup.py install for psycopg2: ...
remote: Running setup.py install for psycopg2...
remote: Successfully installed Django-1.11 dj-dat...
remote:
remote: -----> $ python manage.py collectstatic --noinput
remote: 63 static files copied to '/tmp/build_bb2...
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 49.1M
remote: -----> Launching...
remote: Released v4
remote: https://lit-shelf-xxxxx.herokuapp.com/ de...
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/lit-shelf-xxxxx.git
* [new branch] master -> master
- アプリケーションのプロセス起動
$ heroku ps:scale web=1
- 状態確認
$ heroku ps
- ブラウザ経由で https://lit-shelf-xxxxx.herokuapp.com/ ...
- ログ確認
$ heroku logs --tail
- Procfile 確認
$ view Procfile
- requirements.txt 確認 (依存関係のあるライブラリ管理)
$ cat requirements.txt
dj-database-url==0.4.1
Django==1.11
gunicorn==19.6.0
psycopg2==2.6.2
whitenoise==3.3.0
- ローカル仮想環境に requirements.txt をインストール &col...
$ python -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
- ローカル仮想環境の無効化
$ deactivate
- ローカル環境 (venv環境下) でサーバー起動
$ python manage.py collectstatic
$ heroku local web
[OKAY] Loaded ENV .env File as KEY=VALUE Format
12:55:24 web.1 | [2017-08-20 12:55:24 +0000] [12622] ...
12:55:24 web.1 | [2017-08-20 12:55:24 +0000] [12622] ...
12:55:24 web.1 | [2017-08-20 12:55:24 +0000] [12622] ...
12:55:24 web.1 | [2017-08-20 12:55:24 +0000] [12625] ...
12:55:32 web.1 | Not Found: /favicon.ico
- ブラウザ経由で 192.168.78.90:5000 へアクセスし確認
*** Heroku アプリ削除 [#d2f49a4b]
$ heroku destroy
▸ WARNING: This will delete ⬢ lit-shelf...
▸ To proceed, type lit-shelf-xxxxx or re-run t...
> lit-shelf-xxxxx
Destroying ⬢ lit-shelf-xxxxx (including all add-o...
ページ名: