heroku cli: CLIコマンド


configをjsonやyamlで出力


最終DeployのコミットID一覧取得

heroku_apps="example1 example2"

for app in $heroku_apps; do \
heroku releases -a $app -n 20 2>/dev/null | grep -P "===|Deploy" | head -n 2; \
done

pg:psql


GPG error


heroku-accounts: 複数herokuアカウントの管理

shell script中のループ

#!/bin/bash

i=0
cat "data.csv" | while IFS=',' read -a cols || [ -n "${cols}" ]; do
  if [ $i == 0 ]; then
    # skip header line
    i=$(($i+1))
    continue;
  fi

  heroku run rake example:example param1=${cols[1]} --app ${cols[0]} < /dev/null 2>/dev/null | grep -A 100 '^Called from' | grep -v "^Called from"
done

rake task一覧

heroku run rake --tasks -a $HEROKU_APP
heroku run rake -T -a $HEROKU_APP

Windows環境にインストール

  1. https://toolbelt.heroku.com/windows から heroku-toolbelt.exe をダウンロードして、インストール
  2. PATHを通すために再起動が必要。
  3. 再起動せずにためすには、
    set HerokuPath=C:\Program Files (x86)\Heroku
    set PATH=%PATH%;C:\Program Files (x86)\Heroku\bin;C:\Program Files (x86)\git\cmd;C:\Program Files (x86)\Git\cmd
    
    heroku login
    
    heroku version
    heroku/toolbelt/3.43.2 (i386-mingw32) ruby/2.1.7
    heroku-cli/5.2.9-e9df6ac (windows-386) go1.6.2
    You have no installed plugins.

特定のweb,workerを再起動

特定のdynoだけ応答不能になる事がある


前のバージョンにロールバック


インストール済みアプリからソースコード取得


CUIのインストール、アップデート、バージョン表示

アプリ

現在のプロセス数表示

heroku ps
=== run: one-off processes
run.1: complete 2012/10/01 12:05:24 (~ 14m ago): `bundle exec irb`

=== web: `bundle exec ruby web.rb -p $PORT`
web.1: up 2012/10/01 12:01:45 (~ 18m ago)

httpアクセスログの表示

heroku logs --tail

メンテナンス/エラー画面の表示

ロケール、タイムゾーンの変更

heroku config:add TZ=Asia/Tokyo
heroku config:add LANG=ja_JP.UTF-8

stackの確認(bamboo, cedar等)

heroku stack --app アプリケーション名

Import/export(legacy)


アプリの削除

  1. 該当アプリを選択 > Settings
  2. Delete app... > アプリケーション名を入力し削除

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2023-05-23 (火) 14:56:03