-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add lab for using private repos #88
Draft
srodenhuis
wants to merge
2
commits into
main
Choose a base branch
from
APL-49
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
slug: use-external-private-repo | ||
title: Use an external private repository | ||
sidebar_label: Using external private repo's | ||
--- | ||
|
||
:::info | ||
Harbor needs to be activated for this lab. | ||
::: | ||
|
||
The App Platform includes an `internal` self-hosted Git service powered by Gitea. When creating a Build, the repository type by default is set to `internal` so you can select one of the internally hosted Git repositories. In this lab we'll use the Build feature to build an image using an external private repository (Github) with `basic-auth` authentication. | ||
|
||
## Create a (Classic) Personal Access Token | ||
|
||
Create a Classic personal access token as documented on the [Github documentation site](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) and add the token to your clipboard. | ||
|
||
## Create a SealedSecret | ||
|
||
1. In the left menu, click on `Sealed Secrets`. | ||
|
||
2. Click on `Create SealedSecret`. | ||
|
||
3. Fill in a name for your secret. In this lab we'll create a secret with the name `my-access-token`. | ||
|
||
4. Select the secret type. Because we're going to use `basic-auth` authentication, select `kubernetes.io/basic-auth`. | ||
|
||
5. Add the secret `Encrypted data`. Add the following key-value pairs: | ||
|
||
- `username=<your-github-account-name>` | ||
- `password=<your-personal-access-token>` | ||
|
||
6. Expand the `Metadata` section and add the following `Annotation`: | ||
|
||
- Key: `tekton.dev/git-0` | ||
- Value: `https://github.com` | ||
|
||
7. Click `Submit`. | ||
|
||
8. Click `Deploy changes`. | ||
|
||
## Create Build | ||
|
||
1. In the left menu, click on `Builds`. | ||
|
||
2. Click on `Create Build`. | ||
|
||
3. Fill in the name `my-private-repo` for your build and a tag (default tag is latest). | ||
|
||
4. Choose `external` for the `Repository type` | ||
|
||
5. Select `Private`. | ||
|
||
6. Select the secret you created in the previous step (my-access-token) from the list. | ||
|
||
7. Choose `Docker` and fill in the repo URL of your private Github repository. | ||
|
||
8. Click `Submit`. | ||
|
||
9. Click `Deploy changes`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link to the Tekton docs does not provide an example for the format of the HTTP basic auth Secret. We could also add this reference for that:
https://github.com/tektoncd/catalog/tree/main/task/git-clone/0.9/#using-basic-auth-credentials