feature:clone
Introduction
feature:clone copies a released version of a feature from the forge into .splent_cache, as a read-only snapshot. It adds the feature to no product, and feature:attach runs it for you when a version is missing.
splent feature:clone splent-io/splent_feature_notepad@v1.2.7
β¬οΈ Cloning splent-io/splent_feature_notepad@v1.2.7
β
Feature 'splent-io/splent_feature_notepad@v1.2.7' cloned successfully (ssh://git@git.splent.io:2223/splent-io/splent_feature_notepad.git).
π Cached (read-only) at: /workspace/.splent_cache/features/splent_io/splent_feature_notepad@v1.2.7
A namespace written splent_io works too. It is tried as written, then with _ turned into -.
Cloning the latest release
splent feature:clone splent-io/splent_feature_notepad
Without @<version> it looks up the latest semver tag on the forge. A repository with no tags, or one it cannot reach, is an error.
When the repository is reachable but the version you asked for does not exist, it warns Version '<v>' not found. Cloning default branch instead.
How it connects
It tries SSH first, then HTTPS, for each repository.
| Situation | Transport |
|---|---|
| SSH works | The forgeβs SSH URL, ssh://git@git.splent.io:2223/<org>/<repo>.git on the default forge |
SSH fails, SPLENT_FORGE_TOKEN set |
HTTPS with the token, sent as a header for the forge host, never written to the URL or .git/config |
| SSH fails, no token | Anonymous HTTPS, for public repositories |
GITHUB_TOKEN is read when SPLENT_FORGE_TOKEN is unset. On a machine with no SSH key, such as a CI runner, set SPLENT_CLONE_TRANSPORT=https to skip SSH.
An attempt gives up when a transfer stays below 1000 bytes/s for 30 seconds, or after 600 seconds, and the next one is tried.
Reference
| Argument | Description |
|---|---|
FULL_NAME |
<namespace>/<repo>, with an optional @<version> |
| Message | What to do |
|---|---|
Repository '<ns>/<repo>' not found or not accessible (tried SSH and HTTPS). |
Check the name, your network and your access, an SSH key or a SPLENT_FORGE_TOKEN with read scope. Exits 1 |
Could not fetch tags for <ns>/<repo>. |
Give a version, or check that the repository has tags. Exits 1 |
Folder already exists: <path> |
The snapshot is already cached. Nothing is cloned |
Invalid format. Use <namespace>/<repo>[@version] |
Add the namespace |
See also
feature:attachpins a released version in the product.feature:forkforks a feature into your account.feature:deleteremoves a snapshot from the cache.