Uploading sources with the territory.dev CLI client
Watch a video walkthrough:
1. Prepare your repository
For C/C++ Projects
Clone your repository and generate compile_commands.json. See examples of how this can be generated
here.
For Go Projects
Clone your repository and ensure your Go module is properly initialized:
go mod download
For Python Projects
If you created a virtualenv for your project, we recommend you install and run territory with
it activated.
2. Add a new repo in the territory.dev interface
Go to settings,
find the "Add" button under Repositories,
enter repository details, choose the "Uploaded" option, and select the appropriate language (C/C++ or Go),
create the new repository by clicking "Save".
3. Install the client
Install with pip within a Python virtualenv:
pip install territory
4. Run the upload
For C/C++ Projects
In the directory containing compile_commands.json run:
territory upload --repo-id $YOUR_REPOSITORY_ID -l c
For Go and Python Projects
In your git repository run:
# Go:
territory upload --repo-id $YOUR_REPOSITORY_ID -l go
# Python:
territory upload --repo-id $YOUR_REPOSITORY_ID -l python
We will scan the repo for modules, package parse results and send the code for indexing.
The specific command containing the repository ID can be found in repository settings under "Recent builds".
First time you use the client, we will open the web browser and you will be asked to authenticate the client in the web app.
Once the upload finishes, indexing will start.
Non-interactive authentication
In case you need to run the upload in an environment where the browser authentication flow is not suitable (e.g. a CI build), you can provide the necessary token manually.
- In "Settings" go to to Upload tokens.
- Create a new token and save its text to a file.
- Point the CLI to the file by adding the
--upload-token-path, e.g.:territory upload \ --upload-token-path /path/to/token \ --repo-id $YOUR_REPOSITORY_ID
Release files for territory 1.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| territory-1.6.0.tar.gz | 233.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| territory-1.6.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 244.7 kB
Release files / territory-1.6.0.tar.gz
| Download URL | territory-1.6.0.tar.gz |
|---|---|
| Size | 233.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
20af20a7e0a36d358d3e6ff99a948c4fd4182934802a014d22d8d151887a84df
|
|
BLAKE2b-256 checksum How to use checksums |
df7b932cf1dcb6ffb0063f87602a4320ce0eb525cee6309b4bb044aaf356e904
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.3
|
Release files / territory-1.6.0-py2.py3-none-any.whl
| Download URL | territory-1.6.0-py2.py3-none-any.whl |
|---|---|
| Size | 11.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
14792d7a1c4a57db29f5a0cc8a01a4f45dcb776758f341802fc0bb62108e6c70
|
|
BLAKE2b-256 checksum How to use checksums |
f270ab1f55144b5b82fc19990712176ec94eb76930d165a547e426be339c2dca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.3
|