Skip to content

Commit

Permalink
remove examples directory (#280)
Browse files Browse the repository at this point in the history
Signed-off-by: Manabu McCloskey <manabu.mccloskey@gmail.com>
  • Loading branch information
nabuskey authored Jun 17, 2024
1 parent 9ed2ad1 commit e8e2319
Show file tree
Hide file tree
Showing 85 changed files with 22 additions and 14,439 deletions.
35 changes: 22 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ You can obtain credentials for them by running the following command:

### Example commands

**For more advanced use cases, check out the [examples](./examples) directory.**
**For more advanced use cases, check out the [Stacks Repository](https://github.com/cnoe-io/stacks).**

You can specify the kubernetes version by using the `--kube-version` flag. Supported versions are available [here](https://github.com/kubernetes-sigs/kind/releases).

Expand Down Expand Up @@ -157,19 +157,25 @@ This flag expects a directory (local or remote) containing ArgoCD application fi
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).
Examples of using custom packages are available in the [example](./examples) directory.
Let's take a look at [this example](examples/basic). This defines two custom package directories to deploy to the cluster.
Examples of using custom packages are available in the [stacks repository](https://github.com/cnoe-io/stacks).
Let's take a look at [this example](https://github.com/cnoe-io/stacks/tree/main/basic). This defines two custom package directories to deploy to the cluster.
To deploy these packages, run the following commands from this repository's root.
To deploy these packages, run the following command.
```
./idpbuilder create --package-dir examples/basic/package1 --package-dir examples/basic/package2
idpbuilder create -p https://github.com/cnoe-io/stacks//basic/package1 -p https://github.com/cnoe-io/stacks//basic/package2

```
Alternatively, you can use the URL format:
Alternatively, you can use the local directory format.
```bash
# clone the stacks repository
git clone https://github.com/cnoe-io/stacks.git
cd stacks
# run idpbuilder against the local directory
idpbuilder create --package-dir basic/package1 --package-dir basic/package2
```
./idpbuilder create --package-dir https://github.com/cnoe-io/idpbuilder//examples/basic/package1 --package-dir https://github.com/cnoe-io/idpbuilder//examples/basic/package2
```

Running this command should create three additional ArgoCD applications in your cluster.
Expand All @@ -182,9 +188,11 @@ guestbook2 Synced Healthy
my-app Synced Healthy
```

Let's break this down. The [first package directory](examples/basic/package1) defines an application. This corresponds to the `my-app` application above. In this application, we want to deploy manifests from local machine in GitOps way.
Let's break this down. The [first package directory](https://github.com/cnoe-io/stacks/tree/main/basic/package1) defines an application.
This corresponds to the `my-app` application above. In this application, we want to deploy manifests from local machine in GitOps way.

The directory contains an [ArgoCD application file](examples/basic/package1/app.yaml). This is a normal ArgoCD application file except for one field.
The directory contains an [ArgoCD application file](https://github.com/cnoe-io/stacks/blob/main/basic/package1/app.yaml).
This is a normal ArgoCD application file except for one field.

```yaml
apiVersion: argoproj.io/v1alpha1
Expand All @@ -195,7 +203,8 @@ spec:
```
The `cnoe://` prefix in the `repoURL` field indicates that we want to sync from a local directory.
Values after `cnoe://` is treated as a relative path from this file. In this example, we are instructing idpbuilder to make ArgoCD sync from files in the [manifests directory](examples/basic/package1/manifests).
Values after `cnoe://` is treated as a relative path from this file. In this example,
we are instructing idpbuilder to make ArgoCD sync from files in the [manifests directory](https://github.com/cnoe-io/stacks/tree/main/basic/package1/manifests).

As a result the following actions were taken by idpbuilder:
1. Create a Gitea repository.
Expand All @@ -207,7 +216,7 @@ You can verify this by going to this address in your browser: https://gitea.cnoe
![img.png](docs/images/my-app-repo.png)


This is the repository that corresponds to the [manifests](examples/basic/package1/manifests) folder.
This is the repository that corresponds to the [manifests](https://github.com/cnoe-io/stacks/tree/main/basic/package1/manifests) folder.
It contains a file called `alpine.yaml`, synced from the `manifests` directory above.

You can also view the updated Application spec by going to this address: https://argocd.cnoe.localtest.me:8443/applications/argocd/my-app
Expand All @@ -225,7 +234,7 @@ If you'd like to contribute to the project or know the architecture and internal

## Running in Codespaces

1. Create a Codespaces instance. ![img](examples/ref-implementation/images/codespaces-create.png)
1. Create a Codespaces instance. ![img](https://github.com/cnoe-io/stacks/blob/main/ref-implementation/images/codespaces-create.png)
2. Wait for it to be ready. It may take several minutes.
3. Get the latest release of idpbuilder:
```bash
Expand Down
18 changes: 0 additions & 18 deletions examples/basic/README.md

This file was deleted.

24 changes: 0 additions & 24 deletions examples/basic/package1/app.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions examples/basic/package1/manifests/alpine.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions examples/basic/package2/app.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions examples/basic/package2/app2.yaml

This file was deleted.

169 changes: 0 additions & 169 deletions examples/local-backup/README.md

This file was deleted.

12 changes: 0 additions & 12 deletions examples/local-backup/demo/backup.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions examples/local-backup/demo/restore.yaml

This file was deleted.

Binary file removed examples/local-backup/images/bucket.png
Binary file not shown.
Binary file removed examples/local-backup/images/nginx-backup.png
Binary file not shown.
Loading

0 comments on commit e8e2319

Please sign in to comment.