Skip to content

Commit

Permalink
command update in git tutorial (#1935)
Browse files Browse the repository at this point in the history
## Description
On the git-data [example](https://docs.zarf.dev/examples/git-data/)
command `zarf tools get-admin-password` does not exist anymore. Replace
this with `zarf tools get-creds Git` which will give the desired
password

## Related Issue

Fixes #1934 
<!-- or -->
Relates to #

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed

---------

Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Co-authored-by: Wayne Starr <Racer159@users.noreply.github.com>
Co-authored-by: razzle <harry@razzle.cloud>
  • Loading branch information
3 people authored Aug 2, 2023
1 parent aa5f541 commit c48b3bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 59 deletions.
60 changes: 1 addition & 59 deletions examples/git-data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,70 +36,12 @@ If you need even more control, Zarf also supports providing full `git` [refspecs

Full clones are used in this example with the `stefanprodan/podinfo` repository and follow the `scheme://host/repo` format (`https://github.com/stefanprodan/podinfo.git`). Full clones will contain **all** branches and tags in the mirrored repository rather than any one specific tag.

## Example Usage

This example assumes you have already initialized a Zarf cluster. If that is not the case, refer to the [Initializing the Cluster Tutorial](../../docs/5-zarf-tutorials/1-initializing-a-k8s-cluster.md). Be sure when initializing the Zarf cluster to deploy the `git` component, or be ready to specify an external `git` repository.

### Create the Zarf Package

To create this Zarf package run the below command:

```bash
zarf package create examples/git-data
```

Successful execution will create a package named `zarf-package-git-data-<arch>-<vx.x.x>.tar.zst`.

### Deploying the Zarf Package

To deploy the Zarf package, copy it to a machine that either has a Zarf cluster deployed with the `git` component or an accessible external repository and the `zarf` executable in your `PATH`.

With the Zarf package in the current working directory, execute the below command to deploy the package, uploading the Git repositories to Gitea and the container images to the Docker registry.

```bash
zarf package deploy zarf-package-git-data-<arch>-<vx.x.x>.tar.zst
```

:::note

If you are using an external `git` repository you should specify it here with the git url and user flags.
If you want to learn more about how Zarf works with GitOps, see the [podinfo-flux](../podinfo-flux/) example.

:::

### Applying the Kustomization

Once the package has been deployed, the Kustomization can be applied from the `git` repository using the below command.

:::note

The following assumes you are using the internal Gitea server. If you are using an external server `zarf connect` is not required and you must change the user/url information as needed.*

:::

```bash
# Run 'zarf connect' and send it to the background
zarf connect git&

# Apply the kustomization
zarf tools kubectl apply -k http://zarf-git-user:$(zarf tools get-admin-password)@localhost:<WhicheverPortGotUsed>/zarf-git-user/mirror__github.com__stefanprodan__podinfo//kustomize

# Inspect
zarf tools k9s

# Bring the connection back to the foreground
fg

# Kill the connection with Ctrl-C
```

## Clean Up

Clean up simply by just deleting the whole cluster

```bash
kind delete cluster
```

## `zarf.yaml` {#zarf.yaml}

:::info
Expand Down
1 change: 1 addition & 0 deletions examples/git-data/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ components:
- https://github.com/defenseunicorns/zarf-public-test.git@01a23218923f24194133b5eb11268cf8d73ff1bb
# The following performs a SHA Git Repo Mirror forcing a fallback to host `git`
- https://racer159.visualstudio.com/zarf-public-test/_git/zarf-public-test@01a23218923f24194133b5eb11268cf8d73ff1bb

0 comments on commit c48b3bb

Please sign in to comment.