-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add docs for using the gitea token (#69)
Signed-off-by: Manabu McCloskey <[email protected]>
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,6 +134,56 @@ Delete a cluster named `localdev`. | |
idpbuilder delete --name localdev | ||
``` | ||
|
||
|
||
### Gitea Integration | ||
|
||
idpbuilder creates an internal [Gitea](https://about.gitea.com/) server (accessible from your laptop and kind cluster only). | ||
This can be used for various purposes such as sources for ArgoCD, container registry, and more. | ||
To facilitate interactions with Gitea, idpbuilder creates a token with administrator scope, then stores it in a Kubernetes secret. | ||
|
||
The token can be obtained by running the following command: | ||
|
||
```bash | ||
# print all secrets associated with gitea | ||
idpbuilder get secrets -p gitea | ||
|
||
# get token only | ||
idpbuilder get secrets -p gitea -o json | jq -r '.[0].data.token | ||
``` | ||
Here are a some examples for using the token: | ||
<details> | ||
<summary>Create a Gitea Organization</summary> | ||
```bash | ||
TOKEN=$(idpbuilder get secrets -p gitea -o json | jq -r '.[0].data.token' ) | ||
curl -k -X POST \ | ||
https://gitea.cnoe.localtest.me:8443/api/v1/orgs \ | ||
-H 'Content-Type: application/json' \ | ||
-H "Authorization: Bearer $TOKEN" \ | ||
-d '{"description": "my-org", "email": "[email protected]", "full_name": "my-org", "username": "my-org"}' | ||
``` | ||
</details> | ||
<details> | ||
<summary>Create a Gitea User</summary> | ||
```bash | ||
TOKEN=$(idpbuilder get secrets -p gitea -o json | jq -r '.[0].data.token' ) | ||
curl -k -X POST \ | ||
https://gitea.cnoe.localtest.me:8443/api/v1/admin/users \ | ||
-H 'Content-Type: application/json' \ | ||
-H "Authorization: Bearer $TOKEN" \ | ||
-d '{"email": "[email protected]", "full_name": "user one", "username": "user1", "password": "password", "must_change_password": true}' | ||
``` | ||
</details> | ||
### Custom Packages | ||
Idpbuilder supports specifying custom packages using the flag `-p` flag. This flag expects a directory (local or remote) containing ArgoCD application files and / or ArgoCD application set files. In case of a remote directory, it must be a directory in a git repository, and the URL format must be a [kustomize remote URL format](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md). | ||
|