From 78dabb520dbb4bded57d9ea818a4bdab510c8ec5 Mon Sep 17 00:00:00 2001 From: AndyZe Date: Sat, 18 Jan 2025 19:55:07 -0600 Subject: [PATCH 1/3] Add documentation for github private repos --- doc/index.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/doc/index.rst b/doc/index.rst index 1357545f..28ed1ee4 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -413,6 +413,29 @@ References: - https://docs.gitlab.com/ce/ssh/README.html - https://docs.gitlab.com/ee/ci/ssh_keys/README.html +(Github CI) Access to private repositories +------------------------------------------ + +Follow a process very similar to the Gitlab one, described above, to add public and private SSH keys to your repositories. + +#. Add the private SSH key to your target repository, under Settings-Secrets and Variables-Actions-Secrets. +#. Add the public SSH key to the dependency repository, under Settings-Deploy Keys. +#. Modify the industrial_ci yaml config, adding an action to clone the dependency as follows. The following example clones two dependencies: + +.. code-block:: yaml + + - uses: actions/checkout@v4 # dependency1 + with: + ssh-key: ${{ secrets.DEPENDENCY1 }} + repository: your_org_name/dep1_repo + path: dep1_repo + - uses: actions/checkout@v4 # dependency2 + with: + ssh-key: ${{ secrets.DEPENDENCY2 }} + repository: your_org_name/dep2_repo + path: dep2_repo + + (Recommended) Subscribe to the change in this repo (industrial_ci) --------------------------------------------------------------------------------- From 0f9d5f535a90488e0295c3f8ecc52aca99c17d35 Mon Sep 17 00:00:00 2001 From: AndyZe Date: Thu, 23 Jan 2025 14:54:34 -0600 Subject: [PATCH 2/3] Refactor section headings, give more detail on SSH key definitions --- doc/index.rst | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/doc/index.rst b/doc/index.rst index 28ed1ee4..e50d2a2a 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -363,8 +363,11 @@ To do so, simply set ``DOCKER_COMMIT`` the name of the image of your choice. The script: - docker push $DOCKER_COMMIT -(Gitlab CI) Access to private repositories ------------------------------------------- +Access to private repositories +------------------------------ + +Gitlab +++++++ If your Gitlab CI jobs require access to private repos, additional settings are needed both on: @@ -413,14 +416,16 @@ References: - https://docs.gitlab.com/ce/ssh/README.html - https://docs.gitlab.com/ee/ci/ssh_keys/README.html -(Github CI) Access to private repositories ------------------------------------------- +Github +++++++ Follow a process very similar to the Gitlab one, described above, to add public and private SSH keys to your repositories. #. Add the private SSH key to your target repository, under Settings-Secrets and Variables-Actions-Secrets. #. Add the public SSH key to the dependency repository, under Settings-Deploy Keys. -#. Modify the industrial_ci yaml config, adding an action to clone the dependency as follows. The following example clones two dependencies: +#. Modify the industrial_ci yaml config, adding an action to clone the dependency as follows. + +The following example clones two dependencies. It uses private SSH keys which have been saved as Github "secrets" named DEPENDENCY1 and DEPENDENCY2. The dep1_repo and dep2_repo should have corresponding "Deploy keys", which are the public ssh key. .. code-block:: yaml From d2ad787f48a611e4d759c41b694b93ec82fc50fc Mon Sep 17 00:00:00 2001 From: AndyZe Date: Sun, 2 Feb 2025 16:35:50 -0600 Subject: [PATCH 3/3] Add a warning about nested repositories --- doc/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/index.rst b/doc/index.rst index e50d2a2a..add5554a 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -419,7 +419,7 @@ References: Github ++++++ -Follow a process very similar to the Gitlab one, described above, to add public and private SSH keys to your repositories. +Follow a process very similar to the Gitlab one, described above, to add public and private SSH keys to your repositories. Warning: this clones selected repositories into the current repositories (which might lead to nested packages). #. Add the private SSH key to your target repository, under Settings-Secrets and Variables-Actions-Secrets. #. Add the public SSH key to the dependency repository, under Settings-Deploy Keys.