Class: Souls::Functions

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

Instance Method Summary collapse

Instance Method Details

#deployObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/souls/cli/gcloud/functions/index.rb', line 4

def deploy
  require(Souls.get_mother_path.to_s + "/config/souls")
  project_id = Souls.configuration.project_id
  Dir.chdir(Souls.get_functions_path.to_s) do
    system(
      "
      gcloud functions deploy souls_functions --project=#{project_id} \
      --runtime ruby27 --trigger-http --allow-unauthenticated --env-vars-file .env.yaml
      "
    )
  end
end

#describeObject



18
19
20
21
22
# File 'lib/souls/cli/gcloud/functions/index.rb', line 18

def describe
  require(Souls.get_mother_path.to_s + "/config/souls")
  project_id = Souls.configuration.project_id
  system("gcloud functions describe souls_functions --project=#{project_id}")
end

#devObject



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

def dev
  Dir.chdir(Souls.get_functions_path.to_s) do
    system("bundle exec functions-framework-ruby --target souls_functions")
  end
end

#urlObject



25
26
27
28
29
# File 'lib/souls/cli/gcloud/functions/index.rb', line 25

def url
  require(Souls.get_mother_path.to_s + "/config/souls")
  project_id = Souls.configuration.project_id
  system("gcloud functions describe souls_functions --project=#{project_id}| grep url")
end