0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GoogleAppEngineでデプロイしたサービスの中で、一番古いバージョンをワンライナーで取得する

Posted at

普段使っているbashの内容:v:

$ gcloud app versions list
SERVICE  VERSION          TRAFFIC_SPLIT  LAST_DEPLOYED              SERVING_STATUS
default  20180714t135514  0.00           2018-07-14T13:55:58+09:00  SERVING
default  20180714t150430  1.00           2018-07-14T15:04:53+09:00  SERVING

と、versionの一覧を普通に取得すると、上のような形で帰ってきます。

grep default | sort -k 4,4 | awk '{print $2}' | head -n 1

これを追加して実行してあげると

$ gcloud app versions list | grep default | sort -k 4,4 | awk '{print $2}' | head -n 1
20180714t135514

こんな感じで帰って来てくれます!

後は貯まりすぎたversionを消すなりなんなりご自由に:kissing_heart:

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?