Class: SOULs::Iam

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

Instance Method Summary collapse

Instance Method Details

#setup_keyObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/souls/cli/gcloud/iam/index.rb', line 4

def setup_key
  Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
    Whirly.status = "Setting up credentials and permissions..."
    region = SOULs.configuration.region
    SOULs::Gcloud.new.
    SOULs::Upgrade.new.config
    
    
    SOULs::Gcloud.new.enable_permissions
    add_permissions
    begin
      system("gcloud app create --region=#{region} --quiet")
    rescue StandardError, error
      puts("gcloud app region is Already exist! - SOULs::Gcloud::Iam.setup_key")
    end
    begin
      set_gh_secret_json
    rescue StandardError
      export_key_to_console
    end
  end
  SOULs::Painter.success("You're all set!")
  true
end