Skip to content

Commit

Permalink
Improve docs to encourage using secrets (#3272)
Browse files Browse the repository at this point in the history
* Improved docs

* Update docs/book/how-to/project-setup-and-management/setting-up-a-project-repository/connect-your-git-repository.md

Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>
  • Loading branch information
AlexejPenner and hyperlint-ai[bot] authored Dec 20, 2024
1 parent 384cb8b commit 2d8b354
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ zenml code-repository register <NAME> --type=github \

where \<REPOSITORY> is the name of the code repository you are registering, \<OWNER> is the owner of the repository, \<NAME> is the name of the repository, \<GITHUB\_TOKEN> is your GitHub Personal Access Token and \<GITHUB\_URL> is the URL of the GitHub instance which defaults to `https://github.com.` You will need to set a URL if you are using GitHub Enterprise.

{% hint style="warning" %}
Please refer to the section on using secrets for stack configuration in order to securely store your GitHub
Personal Access Token.

```shell
# Using central secrets management
zenml secret create github_secret \
--pa_token=<GITHUB_TOKEN>

# Then reference the username and password
zenml code-repository register ... --token={{github_secret.pa_token}}
...
```
{% endhint %}

After registering the GitHub code repository, ZenML will automatically detect if your source files are being tracked by GitHub and store the commit hash for each pipeline run.

<details>
Expand Down Expand Up @@ -96,6 +111,21 @@ zenml code-repository register <NAME> --type=gitlab \

where `<NAME>` is the name of the code repository you are registering, `<GROUP>` is the group of the project, `<PROJECT>` is the name of the project, \<GITLAB\_TOKEN> is your GitLab Personal Access Token, and \<GITLAB\_URL> is the URL of the GitLab instance which defaults to `https://gitlab.com.` You will need to set a URL if you have a self-hosted GitLab instance.

{% hint style="warning" %}
Please refer to the section on using secrets for stack configuration in order to securely store your GitLab
Personal Access Token.

```shell
# Using central secrets management
zenml secret create gitlab_secret \
--pa_token=<GITLAB_TOKEN>

# Then reference the username and password
zenml code-repository register ... --token={{gitlab_secret.pa_token}}
...
```
{% endhint %}

After registering the GitLab code repository, ZenML will automatically detect if your source files are being tracked by GitLab and store the commit hash for each pipeline run.

<details>
Expand Down

0 comments on commit 2d8b354

Please sign in to comment.