2020-11-06 12:50:16 +01:00
|
|
|
Command line usage
|
|
|
|
==================
|
|
|
|
|
|
|
|
.. argparse::
|
|
|
|
:module: kas.kas
|
|
|
|
:func: kas_get_argparser
|
|
|
|
:prog: kas
|
|
|
|
|
|
|
|
|
|
|
|
Environment variables
|
|
|
|
---------------------
|
|
|
|
|
2021-07-03 23:35:40 +02:00
|
|
|
+--------------------------+--------------------------------------------------+
|
|
|
|
| Environment variables | Description |
|
|
|
|
+==========================+==================================================+
|
|
|
|
| ``KAS_WORK_DIR`` | The path of the kas work directory, current work |
|
|
|
|
| | directory is the default. |
|
|
|
|
+--------------------------+--------------------------------------------------+
|
|
|
|
| ``KAS_BUILD_DIR`` | The path build directory, |
|
|
|
|
| | ``${KAS_WORK_DIR}/build`` is the default. |
|
|
|
|
+--------------------------+--------------------------------------------------+
|
|
|
|
| ``KAS_REPO_REF_DIR`` | The path to the repository reference directory. |
|
|
|
|
| | Repositories in this directory are used as |
|
|
|
|
| | references when cloning. In order for kas to |
|
|
|
|
| | find those repositories, they have to be named |
|
|
|
|
| | in a specific way. The repo URLs are translated |
|
|
|
|
| | like this: |
|
|
|
|
| | "https://github.com/siemens/meta-iot2000.git" |
|
|
|
|
| | resolves to the name |
|
|
|
|
| | "github.com.siemens.meta-iot2000.git". |
|
auto create repo refs when setting KAS_REPO_REF_DIR
This patch reworks the logic when setting KAS_REPO_REF_DIR.
When this variable is set, a two-staged clone is used:
First, a bare-clone (or similar) is created in the ref-dir, according to
the naming scheme. This clone is executed in a way that is both
reentrant as well as race-free across multiple instances of KAS working
on the same dir. Internally we clone into a tmpdir below the refdir and
rename on success to guarantee the atomicity of the operation on POSIX
compliant filesystems.
Second, the clone in the KAS_WORK_DIR is executed against the local
copy. After that, the origin url is redirected to the upstream url.
By that, the KAS_REPO_REF_DIR directory can be cached across builds
which significantly speedsup clone times against large repos.
In case the requested refspec is already in the cache (very likely in CI
builds), no direct access to the upstream repo is required. This logic
is crucial for CI systems in China, where e.g. access to github is
blocked from time to time.
The clone-from-local logic is currently only implemented for the git plugin
as HG misses the caching logic. Repo implementations that do not support this
logic can simply opt-out for the first stage by returning 'true'.
The existing user-facing logic of KAS_REPO_REF_DIR is not affected.
However, internally we no longer clone via --reference as this still
requires access to the remote repo, even if the requested commit is
already in the local copy.
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2023-01-05 08:50:21 +01:00
|
|
|
| | Repositories that are not found will be cloned |
|
|
|
|
| | below this directory. Multiple instances of kas |
|
|
|
|
| | can simultaneously work on the same directory, |
|
|
|
|
| | as long as the underlying filesystem is POSIX |
|
|
|
|
| | compatible. |
|
2021-07-03 23:35:40 +02:00
|
|
|
+--------------------------+--------------------------------------------------+
|
|
|
|
| ``KAS_DISTRO`` | This overwrites the respective setting in the |
|
|
|
|
| ``KAS_MACHINE`` | configuration file. |
|
|
|
|
| ``KAS_TARGET`` | |
|
|
|
|
| ``KAS_TASK`` | |
|
|
|
|
+--------------------------+--------------------------------------------------+
|
|
|
|
| ``KAS_PREMIRRORS`` | Specifies alternatives for repo URLs. Just like |
|
2022-11-15 10:53:56 +01:00
|
|
|
| ``DISTRO_APT_PREMIRRORS``| bitbake ``PREMIRRORS``, this variable consists |
|
2021-07-03 23:35:40 +02:00
|
|
|
| | of new-line separated entries. Each entry |
|
|
|
|
| | defines a regular expression to match a URL and, |
|
|
|
|
| | space-separated, its replacement. E.g.: |
|
|
|
|
| | "http://.*\.someurl\.io/ http://localmirror.net/"|
|
|
|
|
+--------------------------+--------------------------------------------------+
|
|
|
|
| ``SSH_PRIVATE_KEY`` | Variable containing the private key that should |
|
|
|
|
| | be added to an internal ssh-agent. This key |
|
|
|
|
| | cannot be password protected. This setting is |
|
|
|
|
| | useful for CI build servers. On desktop |
|
|
|
|
| | machines, an ssh-agent running outside the kas |
|
|
|
|
| | environment is more useful. |
|
|
|
|
+--------------------------+--------------------------------------------------+
|
|
|
|
| ``SSH_PRIVATE_KEY_FILE`` | Path to the private key file that should be |
|
|
|
|
| | added to an internal ssh-agent. This key cannot |
|
|
|
|
| | be password protected. This setting is useful |
|
|
|
|
| | for CI build servers. On desktop machines, an |
|
|
|
|
| | ssh-agent running outside the kas environment is |
|
|
|
|
| | more useful. |
|
|
|
|
+--------------------------+--------------------------------------------------+
|
|
|
|
| ``SSH_AUTH_SOCK`` | SSH authentication socket. Used for cloning over |
|
|
|
|
| | SSH (alternative to ``SSH_PRIVATE_KEY`` or |
|
|
|
|
| | ``SSH_PRIVATE_KEY_FILE``). |
|
|
|
|
+--------------------------+--------------------------------------------------+
|
|
|
|
| ``DL_DIR`` | Environment variables that are transferred to |
|
|
|
|
| ``SSTATE_DIR`` | the bitbake environment. |
|
|
|
|
| ``TMPDIR`` | |
|
|
|
|
+--------------------------+--------------------------------------------------+
|
2021-07-12 07:55:32 +02:00
|
|
|
| ``http_proxy`` | These variables define the proxy configuration |
|
|
|
|
| ``https_proxy`` | bitbake should use. |
|
2021-07-03 23:35:40 +02:00
|
|
|
| ``ftp_proxy`` | |
|
|
|
|
| ``no_proxy`` | |
|
|
|
|
+--------------------------+--------------------------------------------------+
|
|
|
|
| ``GIT_PROXY_COMMAND`` | Set proxy for native git fetches. ``NO_PROXY`` |
|
|
|
|
| ``NO_PROXY`` | is evaluated by OpenEmbedded's oe-git-proxy |
|
|
|
|
| | script. |
|
|
|
|
+--------------------------+--------------------------------------------------+
|
|
|
|
| ``SHELL`` | The shell to start when using the `shell` |
|
|
|
|
| | plugin. |
|
|
|
|
+--------------------------+--------------------------------------------------+
|
|
|
|
| ``TERM`` | The terminal options used in the `shell` plugin. |
|
|
|
|
+--------------------------+--------------------------------------------------+
|
|
|
|
| ``AWS_CONFIG_FILE`` | Path to the awscli configuration and credentials |
|
|
|
|
| |aws_cred| | file that are copied to the kas home dir. |
|
|
|
|
+--------------------------+--------------------------------------------------+
|
2023-03-02 08:25:51 +01:00
|
|
|
| |git_cred| | Allows to set and configure the git credential |
|
|
|
|
| | helper in the `.gitconfig` of the kas user. |
|
2021-07-03 23:35:40 +02:00
|
|
|
+--------------------------+--------------------------------------------------+
|
2022-06-23 14:51:22 +02:00
|
|
|
| ``NETRC_FILE`` | Path to a .netrc file which will be copied to |
|
|
|
|
| | the kas home dir as .netrc. |
|
|
|
|
+--------------------------+--------------------------------------------------+
|
2022-04-21 13:08:22 +02:00
|
|
|
| ``CI_SERVER_HOST`` | Environment variables from gitlab CI, if set |
|
|
|
|
| ``CI_JOB_TOKEN`` | .netrc is configured to allow fetching from |
|
2022-06-23 14:51:22 +02:00
|
|
|
| | the gitlab instance. An entry will be appended |
|
|
|
|
| | in case ``NETRC_FILE`` was given as well. Note |
|
|
|
|
| | that if the file already contains an entry for |
|
|
|
|
| | that host most tools would probably take that |
|
|
|
|
| | first one. |
|
2022-04-21 13:08:22 +02:00
|
|
|
+--------------------------+--------------------------------------------------+
|
2022-10-19 10:57:36 +02:00
|
|
|
| ``BB_NUMBER_THREADS`` | Environment variables to control the concurrency |
|
|
|
|
| ``PARALLEL_MAKE`` | |
|
|
|
|
+--------------------------+--------------------------------------------------+
|
2020-11-06 12:50:16 +01:00
|
|
|
|
|
|
|
.. |aws_cred| replace:: ``AWS_SHARED_CREDENTIALS_FILE``
|
2023-03-02 08:25:51 +01:00
|
|
|
.. |git_cred| replace:: ``GIT_CREDENTIAL_HELPER`` ``GIT_CREDENTIAL_USEHTTPPATH``
|