Skip to content
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

command update in git tutorial #1935

Merged
merged 9 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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