okfn/dpm — Issue #11: push command to push material to remote CKAN
Author: rgrp
Created: 2011-10-26 09:14:18+00:00
State: open

push commands sync source package on local disk with remote CKAN (with webstore). Different from upload in that it is more source code like (hg push / git push), designed pushing individual source files to e.g. webstore rather than uploading a tar.gz of built package.

Remarks:

* Need to push resources *before* metadata because metadata will reference resources
* What about just using webstorer? Answer: no, because these resources will live in *my* namespace in webstore and be continuously updated ...

Process:

* Look at directory for a datapackage.json
* If not found exit
* Look in .dpm/config in current directory
* Find section [remote] and look for url attribute
* Assume this is CKAN instance
* Extract CKAN url
* [?? do we need to try pushing metadata at this point to check e.g. name is available?]
* Read resources in datapackage.json
* For each resource with a local_url
* If no file exists: continue
* Decide whether file is pushable to webstore
* If not print warning and continue
* Check if webstore_url exists.
* If not generate it
* Push to webstore
* Save webstore_url to resource and write datapackage.json
* Save url to data (e.g. webstore csv?)
* Push metadata to CKAN instance
* ...