@@ -29,28 +29,27 @@ def app():
2929
3030@click .option ("--metadata" , "metadata_file" , type = click .Path (exists = True ),
3131 help = "Path to metadata JSON file (for metadata mode)" )
32- @click .option ("--webdav-url" , "webdav_url" , help = "WebDAV URL (e.g., https://cloud.example.com/remote.php/webdav)" )
33- @click .option ("--remote" , help = "rclone remote name (e.g., 'nextcloud')" )
34- @click .option ("--path" , help = "Remote path on Nextcloud (e.g., 'datasets/mydataset')" )
32+ @click .option ("--remote" , help = "rclone remote name (e.g., 'my-nextcloud')" )
33+ @click .option ("--path" , help = "Remote path on Rclone Remote (e.g., 'datasets/mydataset')" )
3534
3635@click .argument ("distributions" , nargs = - 1 )
3736def deploy (version_id , title , abstract , description , license_url , apikey ,
38- metadata_file , webdav_url , remote , path , distributions : List [str ]):
37+ metadata_file , remote , path , distributions : List [str ]):
3938 """
4039 Flexible deploy to Databus command supporting three modes:\n
4140 - Classic deploy (distributions as arguments)\n
4241 - Metadata-based deploy (--metadata <file>)\n
43- - Upload & deploy via Nextcloud (--webdav-url, --remote, --path)
42+ - Upload & deploy via Rclone ( --remote, --path)
4443 """
4544
4645 # Sanity checks for conflicting options
47- if metadata_file and any ([distributions , webdav_url , remote , path ]):
48- raise click .UsageError ("Invalid combination: when using --metadata, do not provide --webdav-url, -- remote, --path, or distributions." )
49- if any ([webdav_url , remote , path ]) and not all ([webdav_url , remote , path ]):
50- raise click .UsageError ("Invalid combination: when using WebDAV/Nextcloud mode, please provide --webdav-url, --remote, and --path together." )
46+ if metadata_file and any ([distributions , remote , path ]):
47+ raise click .UsageError ("Invalid combination: when using --metadata, do not provide --remote, --path, or distributions." )
48+ if any ([remote , path ]) and not all ([remote , path ]):
49+ raise click .UsageError ("Invalid combination: when using Rclone mode, please provide --remote, and --path together." )
5150
5251 # === Mode 1: Classic Deploy ===
53- if distributions and not (metadata_file or webdav_url or remote or path ):
52+ if distributions and not (metadata_file or remote or path ):
5453 click .echo ("[MODE] Classic deploy with distributions" )
5554 click .echo (f"Deploying dataset version: { version_id } " )
5655
@@ -66,27 +65,27 @@ def deploy(version_id, title, abstract, description, license_url, apikey,
6665 client .deploy_from_metadata (metadata , version_id , title , abstract , description , license_url , apikey )
6766 return
6867
69- # === Mode 3: Upload & Deploy (Nextcloud ) ===
70- if webdav_url and remote and path :
68+ # === Mode 3: Upload & Deploy (Rclone ) ===
69+ if remote and path :
7170 if not distributions :
72- raise click .UsageError ("Please provide files to upload when using WebDAV/Nextcloud mode." )
71+ raise click .UsageError ("Please provide files to upload when using Rclone mode." )
7372
7473 #Check that all given paths exist and are files or directories.#
7574 invalid = [f for f in distributions if not os .path .exists (f )]
7675 if invalid :
7776 raise click .UsageError (f"The following input files or folders do not exist: { ', ' .join (invalid )} " )
7877
79- click .echo ("[MODE] Upload & Deploy to DBpedia Databus via Nextcloud " )
78+ click .echo ("[MODE] Upload & Deploy to DBpedia Databus via Rclone " )
8079 click .echo (f"→ Uploading to: { remote } :{ path } " )
81- metadata = upload .upload_to_nextcloud (distributions , remote , path , webdav_url )
80+ metadata = upload .upload_with_rclone (distributions , remote , path )
8281 client .deploy_from_metadata (metadata , version_id , title , abstract , description , license_url , apikey )
8382 return
8483
8584 raise click .UsageError (
8685 "No valid input provided. Please use one of the following modes:\n "
8786 " - Classic deploy: pass distributions as arguments\n "
8887 " - Metadata deploy: use --metadata <file>\n "
89- " - Upload & deploy: use --webdav-url, -- remote, --path, and file arguments"
88+ " - Upload & deploy: use --remote, --path, and file arguments"
9089 )
9190
9291
0 commit comments