Skip to content

Commit c60a64a

Browse files
authored
fix bug where deploy_name was used for server_name (#288)
* fix bug where deploy_name was used for server_name * include CloudServer in actions.deploy_bundle
1 parent 1221c76 commit c60a64a

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

rsconnect/actions.py

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ def _finalize_deploy(
740740
file_name: str,
741741
app_id: int,
742742
app_mode: AppMode,
743-
name: str,
743+
deployment_name: str,
744744
title: str,
745745
title_is_default: bool,
746746
bundle: typing.IO[bytes],
@@ -755,7 +755,7 @@ def _finalize_deploy(
755755
:param file_name: the primary file or directory being deployed.
756756
:param app_id: the ID of an existing application to deploy new files for.
757757
:param app_mode: the app mode to use.
758-
:param name: the name to use for the deploy.
758+
:param deployment_name: the name to use for the deploy.
759759
:param title: the title to use for the deploy.
760760
:param title_is_default: a flag noting whether the title carries a defaulted value.
761761
:param bundle: the bundle to deploy.
@@ -766,7 +766,7 @@ def _finalize_deploy(
766766
:return: the ultimate URL where the deployed app may be accessed and the sequence
767767
of log lines. The log lines value will be None if a log callback was provided.
768768
"""
769-
app = deploy_bundle(connect_server, app_id, name, title, title_is_default, bundle, None)
769+
app = deploy_bundle(connect_server, app_id, deployment_name, title, title_is_default, bundle, None)
770770
app_url, log_lines, _ = spool_deployment_log(connect_server, app, log_callback)
771771
app_store.set(
772772
connect_server.url,
@@ -1771,7 +1771,7 @@ def create_quarto_deployment_bundle(
17711771
def deploy_bundle(
17721772
remote_server: api.TargetableServer,
17731773
app_id: int,
1774-
name: str,
1774+
deployment_name: str,
17751775
title: str,
17761776
title_is_default: bool,
17771777
bundle: typing.IO[bytes],
@@ -1782,24 +1782,39 @@ def deploy_bundle(
17821782
17831783
:param remote_server: the server information.
17841784
:param app_id: the ID of the app to deploy, if this is a redeploy.
1785-
:param name: the name for the deploy.
1785+
:param deployment_name: the name for the deploy.
17861786
:param title: the title for the deploy.
17871787
:param title_is_default: a flag noting whether the title carries a defaulted value.
17881788
:param bundle: the bundle to deploy.
17891789
:param env_vars: list of (name, value) pairs for the app environment
17901790
:return: application information about the deploy. This includes the ID of the
17911791
task that may be queried for deployment progress.
17921792
"""
1793-
ce = RSConnectExecutor(
1794-
server=remote_server,
1793+
if isinstance(remote_server, api.RSConnectServer):
1794+
ce = RSConnectExecutor(
1795+
url=remote_server.url,
1796+
api_key=remote_server.api_key,
1797+
insecure=remote_server.insecure,
1798+
ca_data=remote_server.ca_data,
1799+
cookies=remote_server.cookie_jar,
1800+
)
1801+
elif isinstance(remote_server, api.ShinyappsServer) or isinstance(remote_server, api.CloudServer):
1802+
ce = RSConnectExecutor(
1803+
url=remote_server.url,
1804+
account=remote_server.account_name,
1805+
token=remote_server.token,
1806+
secret=remote_server.secret,
1807+
)
1808+
else:
1809+
raise RSConnectException("Unable to infer Connect client.")
1810+
ce.deploy_bundle(
17951811
app_id=app_id,
1796-
name=name,
1812+
deployment_name=deployment_name,
17971813
title=title,
17981814
title_is_default=title_is_default,
17991815
bundle=bundle,
18001816
env_vars=env_vars,
18011817
)
1802-
ce.deploy_bundle()
18031818
return ce.state["deployed_info"]
18041819

18051820

0 commit comments

Comments
 (0)