slug | title | sidebar_label |
---|---|---|
use-external-private-repo |
Use an external private repository |
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 as documented on the Github documentation site and add the token to your clipboard.
-
In the left menu, click on
Sealed Secrets
. -
Click on
Create SealedSecret
. -
Fill in a name for your secret. In this lab we'll create a secret with the name
my-access-token
. -
Select the secret type. Because we're going to use
basic-auth
authentication, selectkubernetes.io/basic-auth
. -
Add the secret
Encrypted data
. Add the following key-value pairs:
username=<your-github-account-name>
password=<your-personal-access-token>
- Expand the
Metadata
section and add the followingAnnotation
:
- Key:
tekton.dev/git-0
- Value:
https://github.com
-
Click
Submit
. -
Click
Deploy changes
.
-
In the left menu, click on
Builds
. -
Click on
Create Build
. -
Fill in the name
my-private-repo
for your build and a tag (default tag is latest). -
Choose
external
for theRepository type
-
Select
Private
. -
Select the secret you created in the previous step (my-access-token) from the list.
-
Choose
Docker
and fill in the repo URL of your private Github repository. -
Click
Submit
. -
Click
Deploy changes
.