Skip to main content

Source repositories

Git repositories a task reads in a copy cloned on every run (task.sources). Only the address and the credential: the code never goes through the API.

CommandHTTPDescription
sources listGET /v1/sourcesList source repositories
sources createPOST /v1/sourcesRegister a source repository
sources getGET /v1/sources/{id}Get a source repository
sources updatePATCH /v1/sources/{id}Update a source repository
sources deleteDELETE /v1/sources/{id}Delete a source repository (soft delete)
sources checkPOST /v1/sources/{id}/checkCheck access to the repository

Examples​

--params carries query and path parameters (id, page, filters); --json carries the request body; --fields limits the fields that come back — worth using on every list/get to save context. See Global flags for the full reference.

# List source repositories
kobana kadu sources list --fields "id,name,repository,auth_method,access_status"

# Register a source repository
kobana kadu sources create \
--json '{"name": "apps-billing", "repository": "acme/billing", "ref": "main"}'

# Get the repository: with a deploy key, the public key to register on GitHub
kobana kadu sources get --params '{"id": "SOURCE_ID"}' \
--fields "access_status,deploy_key_public_key,deploy_key_settings_url,next_step"

# Update a source repository (changing the ref resets the check)
kobana kadu sources update \
--params '{"id": "SOURCE_ID"}' \
--json '{"ref": "release"}'

# Check access after registering the deploy key
kobana kadu sources check --params '{"id": "SOURCE_ID"}' \
--fields "access_status,last_commit_sha,last_check_error"

# Delete a source repository (soft delete)
kobana kadu sources delete \
--params '{"id": "SOURCE_ID"}' \
--dry-run

Next steps​