Get the PBL Upload Client
You must download the pbl.py
script to transfer files into the Project Build Library.
Th PBL upload client is free, open-source, and freely modifiable and distributable.
Download the PBL upload client from http://cubit.open.collab.net/pbl/.
Upload a File
To upload a file, run the pbl.py
upload command.
In this example, we upload a file named Release.zip
from our local machine into the public area of the project myproject, in the directory /foo/bar/baz/
.
Run the pbl.py
upload command like this, substituting the correct values for your situation.
pbl.py upload --api-user=username --api-key=713cdf90-2549-1350-80c3-2d0bcf9a1697 --api-url http://$external_host/cubit_api/1 --project=myproject -t pub -r /foo/bar/baz -d "This is the description." /home/Release.zip
pbl.py
recursively uploads all the subdirectories underneath the parent. All the files in the recursive upload get the same description.Once this operation has completed, you can download this file from https://$external_host/myproject/pub/foo/bar/baz/Release.zip.
For other options to pbl.py
, run pbl.py help upload
.
Change the Description of a File
You can change the description associated with a file or directory without changing the file itself or the md5 checksum of the file.
In this example, you have already authenticated and saved your user name and key credentials in your home directory.
Run the pbl.py changedesc
command like this:
pbl.py changedesc -l http://$external_host/cubit_api/1 --project=myproject -t pub -r /foo/bar/baz/Release.zip -d "This is the new description"
Move a File
With the pbl.py move
command, you can move files or directories within a project, or even between projects.
The syntax for this command is a bit different than the rest of the commands, because the other commands only operate on one project or file or directory at a time, and that is not the case the the move operation.
To move a file, run the pbl.py move
command with these options. In the simplest case, we move a file, or a directory and all its contents, from one name to another.
Commands | Description |
---|---|
--srcproj projname | The name of the project the source file is located in. |
--destproj projname | The name of the project to move the file to. If left blank, defaults to value of --srcproj. |
--srcpath path | The path to the file or directory to move. |
--destpath path |
The destination path for the file or directory specified in `--srcpath`. Two important things to note about this option:
|
--srctype {pub|priv} | The visibility type of the source file, either `pub` or `priv`. |
--desttype {pub|priv} | The visibility type of the destination file, either `pub` or`priv`. |
--force | If the destination file exists, the `--force` option must be used to replace it. |
/foo/bar/baz/Release_old.zip
– the last component of the path is interpreted as a file named 'Release_old.zip'
. pbl.py move -l http://$external_host/TeamForge Lab Management_api/1 --srcprj=myproject --srctype=pub --srcpath=/foo/bar/baz/Release.zip --destpath=/foo/bar/baz/Release_old.zip
To move a file from one project to another, and also change it from public to private, run the command like this.
/foo/bar/baz/archive/
– the last component of the path is interpreted as a directory named 'archive'
. pbl.py move -l http://$external_host/TeamForge Lab Management_api/1 --srcprj=myproject --destproj=myproject_archive --srctype=pub --desttype=priv --srcpath=/foo/bar/baz/Release.zip --destpath=/foo/bar/baz/archive/
[]:
[]: