How to automatically delete old Google App Engine version instances?

后端 未结 6 1232
囚心锁ツ
囚心锁ツ 2021-02-12 10:57

I\'m experimenting with more cost effective ways to deploy my Rails apps, and went through the Ruby Starter Projects to get a feel for Google Cloud Platform.

It\'s al

6条回答
  •  耶瑟儿~
    2021-02-12 11:34

    The following removes all version except 5 most recent: Uses ghead (on macOS, brew install coreutils), replace with head for linux.

    gcloud app versions delete `gcloud app versions list | sed 's/  */:/g' | cut -f 2 -d : | tail -n +2 | ghead -n -5 | tr "\n" " "`
    

提交回复
热议问题