@@ -27,8 +27,9 @@ def setup_env(
27
27
profiles_yml : Optional [str ],
28
28
bigquery_keyfile : Optional [str ],
29
29
gcs_keyfile : Optional [str ],
30
+ snowflake_keyfile : Optional [str ],
30
31
):
31
- logging .info (f "Setting up the environment." )
32
+ logging .info ("Setting up the environment." )
32
33
dbt_dir = Path .home () / ".dbt"
33
34
dbt_dir .mkdir (parents = True , exist_ok = True )
34
35
if profiles_yml :
@@ -37,6 +38,8 @@ def setup_env(
37
38
Path ("/tmp/bigquery_keyfile.json" ).write_text (bigquery_keyfile )
38
39
if gcs_keyfile :
39
40
Path ("/tmp/gcs_keyfile.json" ).write_text (gcs_keyfile )
41
+ if snowflake_keyfile :
42
+ Path ("/tmp/snowflake_keyfile.key" ).write_text (snowflake_keyfile )
40
43
41
44
42
45
def install_edr (
@@ -108,7 +111,7 @@ def install_edr(
108
111
109
112
110
113
def run_edr (edr_command : str , project_dir : Optional [str ]):
111
- logging .info (f "Running the edr command." )
114
+ logging .info ("Running the edr command." )
112
115
subprocess .run (edr_command , shell = True , check = True , cwd = project_dir )
113
116
114
117
@@ -119,6 +122,7 @@ class Args(BaseModel):
119
122
profiles_yml : Optional [str ]
120
123
edr_command : str
121
124
bigquery_keyfile : Optional [str ]
125
+ snowflake_keyfile : Optional [str ]
122
126
gcs_keyfile : Optional [str ]
123
127
profile_target : Optional [str ]
124
128
@@ -131,16 +135,22 @@ def main():
131
135
profile_target = os .getenv ("INPUT_PROFILE-TARGET" ) or None ,
132
136
project_dir = os .getenv ("INPUT_PROJECT-DIR" ) or None ,
133
137
bigquery_keyfile = os .getenv ("INPUT_BIGQUERY-KEYFILE" ) or None ,
138
+ snowflake_keyfile = os .getenv ("INPUT_SNOWFLAKE-KEYFILE" ) or None ,
134
139
gcs_keyfile = os .getenv ("INPUT_GCS-KEYFILE" ) or None ,
135
140
adapter_version = os .getenv ("INPUT_ADAPTER-VERSION" ) or None ,
136
141
)
137
142
install_dbt (args .adapter , args .adapter_version )
138
- setup_env (args .profiles_yml , args .bigquery_keyfile , args .gcs_keyfile )
143
+ setup_env (
144
+ args .profiles_yml ,
145
+ args .bigquery_keyfile ,
146
+ args .gcs_keyfile ,
147
+ args .snowflake_keyfile ,
148
+ )
139
149
install_edr (args .adapter , args .project_dir , args .profile_target )
140
150
try :
141
151
run_edr (args .edr_command , args .project_dir )
142
152
except subprocess .CalledProcessError :
143
- logging .exception (f "Failed to run the edr command." )
153
+ logging .exception ("Failed to run the edr command." )
144
154
raise
145
155
146
156
0 commit comments