souls 1.7.29 → 1.7.33
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c07931ef30cc914dbc6e03e9b6eaf87411f927ff17917faf20c9d865308f808b
|
4
|
+
data.tar.gz: ae6d456bc5df67d66b23393e6dbfd13492220d09266581a459bc323845e50884
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c428b926587c8f911d055dfdc5d6a928fdcd3e9a3b1f007d9540198eb2ada384463e81d6fb4f550266bb91677c3606f00a81ea449f156e588fe3742888bc8552
|
7
|
+
data.tar.gz: 05c5652223e43977a053dee4edc9d0c5dc2bce8e209286ec171c6992d443018ac42b44d0ca2ccef3c54532015aef95f8d9f979208ad14a2c6320ae43ff75a6f3
|
@@ -77,7 +77,7 @@ module Souls
|
|
77
77
|
|
78
78
|
def resolve
|
79
79
|
# First, instantiate the Mailgun Client with your API key
|
80
|
-
mg_client = ::Mailgun::Client.new(
|
80
|
+
mg_client = ::Mailgun::Client.new(ENV['MAILGUN_KEY'])
|
81
81
|
|
82
82
|
# Define your message parameters
|
83
83
|
message_params = {
|
@@ -88,7 +88,7 @@ module Souls
|
|
88
88
|
}
|
89
89
|
|
90
90
|
# Send your message through the client
|
91
|
-
mg_client.send_message(
|
91
|
+
mg_client.send_message(ENV['MAILGUN_DOMAIN'], message_params)
|
92
92
|
{ response: "Job done!" }
|
93
93
|
rescue StandardError => e
|
94
94
|
GraphQL::ExecutionError.new(e.to_s)
|
@@ -2,23 +2,27 @@ module Souls
|
|
2
2
|
class Github < Thor
|
3
3
|
desc "secret_set", "Github Secret Set from .env.production"
|
4
4
|
def secret_set
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
Dir.chdir(Souls.get_mother_path.to_s) do
|
6
|
+
file_path = ".env.production"
|
7
|
+
File.open(file_path, "r") do |file|
|
8
|
+
file.each_line do |line|
|
9
|
+
key_and_value = line.split("=")
|
10
|
+
system("gh secret set #{key_and_value[0]} -b \"#{key_and_value[1].strip}\"")
|
11
|
+
end
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|
13
15
|
|
14
16
|
desc "add_env", "Add New env and Sync Github Secret"
|
15
|
-
method_option :key, aliases: "--key", required: true, desc: "Key Name"
|
16
|
-
method_option :value, aliases: "--value", required: true, desc: "Value Name"
|
17
17
|
method_option :dqm, type: :boolean, aliases: "--dqm", default: false, desc: "Enable Double Quotation Mark"
|
18
18
|
def add_env
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
prompt = TTY::Prompt.new
|
20
|
+
key = prompt.ask("Set Key:")
|
21
|
+
value = prompt.ask("Set Value:")
|
22
|
+
update_env_production(key: key, value: value, dqm: options[:dqm])
|
23
|
+
update_api_env(key: key, value: value, dqm: options[:dqm])
|
24
|
+
update_workers_env(key: key, value: value, dqm: options[:dqm])
|
25
|
+
update_github_actions(key: key)
|
22
26
|
Souls::Github.new.invoke(:secret_set)
|
23
27
|
end
|
24
28
|
|
@@ -52,13 +56,28 @@ module Souls
|
|
52
56
|
end
|
53
57
|
end
|
54
58
|
|
59
|
+
def update_workers_env(key:, value:, dqm: false)
|
60
|
+
Dir.chdir(Souls.get_mother_path.to_s) do
|
61
|
+
workers = Dir["apps/*"]
|
62
|
+
workers.delete("apps/api")
|
63
|
+
workers.each do |worker_path|
|
64
|
+
file_path = "#{worker_path}/.env"
|
65
|
+
File.open(file_path, "a") do |line|
|
66
|
+
dqm ? line.write("\n#{key.upcase}=\"#{value}\"") : line.write("\n#{key.upcase}=#{value}")
|
67
|
+
end
|
68
|
+
puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
55
73
|
def update_github_actions(key:)
|
56
74
|
Dir.chdir(Souls.get_mother_path.to_s) do
|
57
75
|
file_paths = Dir[".github/workflows/*.yml"]
|
58
76
|
file_paths.each do |file_path|
|
59
|
-
File.
|
60
|
-
|
61
|
-
|
77
|
+
worker_workflow = File.readlines(file_path)
|
78
|
+
worker_workflow[worker_workflow.size - 1] = worker_workflow.last.chomp
|
79
|
+
worker_workflow << " \\ \n --set-env-vars=\"#{key.upcase}=${{ secrets.#{key.upcase} }}\""
|
80
|
+
File.open(file_path, "w") { |f| f.write(worker_workflow.join) }
|
62
81
|
puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
|
63
82
|
end
|
64
83
|
end
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.7.
|
1
|
+
1.7.33
|
@@ -1 +1 @@
|
|
1
|
-
1.7.
|
1
|
+
1.7.33
|