Class: Souls::Gcloud

Inherits:
Thor
  • Object
show all
Defined in:
lib/souls/cli/gcloud/index.rb

Instance Method Summary collapse

Instance Method Details

#auth_loginObject



32
33
34
35
36
37
# File 'lib/souls/cli/gcloud/index.rb', line 32

def 
  project_id = Souls.configuration.project_id
  system("gcloud projects describe #{project_id}", out: File::NULL) or raise(Souls::GcloudException)
  system("gcloud config set project #{project_id} >/dev/null 2>&1")
  system("gcloud auth login")
end

#config_setObject



40
41
42
43
44
# File 'lib/souls/cli/gcloud/index.rb', line 40

def config_set
  project_id = Souls.configuration.project_id
  system("gcloud projects describe #{project_id}", out: File::NULL) or raise(Souls::GcloudException)
  system("gcloud config set project #{project_id} >/dev/null 2>&1")
end

#enable_permissionsObject



47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/souls/cli/gcloud/index.rb', line 47

def enable_permissions
  system("gcloud services enable compute.googleapis.com")
  system("gcloud services enable iam.googleapis.com")
  system("gcloud services enable dns.googleapis.com")
  system("gcloud services enable sqladmin.googleapis.com")
  system("gcloud services enable sql-component.googleapis.com")
  system("gcloud services enable servicenetworking.googleapis.com")
  system("gcloud services enable containerregistry.googleapis.com")
  system("gcloud services enable run.googleapis.com")
  system("gcloud services enable vpcaccess.googleapis.com")
  system("gcloud services enable cloudscheduler.googleapis.com")
  system("gcloud services enable cloudresourcemanager.googleapis.com")
end