Skip to content

Commit

Permalink
Lets restructure (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonywendt authored Feb 20, 2024
1 parent 8ed79a1 commit e718536
Show file tree
Hide file tree
Showing 56 changed files with 1,297 additions and 266 deletions.
20 changes: 20 additions & 0 deletions .github/actions/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# action.yml
name: "Setup Environment"
description: "UDS Environment Setup"

runs:
using: "composite"
steps:

- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Install Zarf
shell: bash
# renovate: datasource=github-tags depName=defenseunicorns/zarf versioning=semver
run: brew install defenseunicorns/tap/zarf@0.32.1

- name: Install UDS CLI
shell: bash
# renovate: datasource=github-tags depName=defenseunicorns/uds-cli versioning=semver
run: brew install defenseunicorns/tap/uds@0.7.0
7 changes: 5 additions & 2 deletions .github/workflows/publish-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
repository: ${{ github.repository }}
ref: ${{ github.ref_name }}

- name: Environment setup
uses: ./.github/actions/setup

- name: Login to Registry1
uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -53,8 +56,8 @@ jobs:
# Build and publish bundle
####
- name: Build bundle
run: make build/all
run: uds run create-bundle

- name: Publish bundle
run: ./uds publish uds-bundle-software-factory-nutanix-amd64-*.tar.zst oci://ghcr.io/defenseunicorns/uds-bundle --no-progress
run: uds publish uds-bundle-software-factory-nutanix-amd64-*.tar.zst oci://ghcr.io/defenseunicorns/uds-bundle --no-progress
working-directory: build
46 changes: 46 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"debug.javascript.terminalOptions": {
"enableTurboSourcemaps": true,
"resolveSourceMapLocations": [
"${workspaceFolder}/**",
"node_modules/kubernetes-fluent-client/**",
"node_modules/pepr/**"
]
},
"yaml.schemas": {
// renovate: datasource=github-tags depName=defenseunicorns/uds-cli versioning=semver
"https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.7.0/uds.schema.json": [
"uds-bundle.yaml"
],

// renovate: datasource=github-tags depName=defenseunicorns/uds-cli versioning=semver
"https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.7.0/tasks.schema.json": [
"tasks.yaml",
"tasks/**/*.yaml",
"src/**/validate.yaml"
],
// renovate: datasource=github-tags depName=defenseunicorns/zarf versioning=semver
"https://raw.githubusercontent.com/defenseunicorns/zarf/v0.32.1/zarf.schema.json": [
"zarf.yaml"
]
},
"cSpell.words": [
"alertmanager",
"Authservice",
"automount",
"controlplane",
"crds",
"distros",
"ironbank",
"Kiali",
"Kyverno",
"MITM",
"neuvector",
"opensource",
"promtail",
"Quickstart",
"seccomp",
"Sysctls",
"Velero"
]
}
133 changes: 0 additions & 133 deletions Makefile

This file was deleted.

51 changes: 20 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ The full list of packages and dependencies installed by the bundle (and an assum
**Infrastructure**:
* Kubernetes cluster
* Access to the cluster with enough privilage to deploy
* A valid domain
* Access to the cluster with enough privilage to deploy
* A valid domain
> NOTE: `*.bigbang.dev` may be used for demomonstration and test deployments.
* Wildcard certificates to cover your domain (alternatively, expand for full SAN list)
<details>
<summary>Individual SAN list </summary>

* `confluence.your.domain`
* `gitlab.your.domain`
* `*.pages.your.domain`
Expand All @@ -51,7 +51,7 @@ The full list of packages and dependencies installed by the bundle (and an assum
</details>
<details>
<summary> Gitlab </summary>

* gitlab-artifacts
* gitlab-backups
* gitlab-ci-secure-files
Expand Down Expand Up @@ -96,18 +96,18 @@ For demonstration purposes, you can setup a local configfile as follows:
* bucket names and credentials
* database names and credentials

> NOTE: the config must be named `uds-config.yaml` and be present in your working directory at deploy time
> NOTE: The config must be named `uds-config.yaml` and either be present in your working directory or have the environment variable UDS_CONFIG set to its location at deploy time
### Deployment
Select a target version number and gather the OCI image reference [from the packages page](https://github.com/orgs/defenseunicorns/packages?repo_name=uds-bundle-software-factory-nutanix). With the above prerequisites and configuration complete, you can deploy the bundle directly via OCI:
```
uds deploy oci://ghcr.io/defenseunicorns/uds-bundle/software-factory-nutanix:0.1.4-amd64 --confirm
uds deploy oci://ghcr.io/defenseunicorns/uds-bundle/software-factory-nutanix:0.1.x --architecure amd64 --confirm
```

### (OPTIONAL) Local Deployment Reference
Situationally, it may be useful to download the deployment artifact so that it may be referenced offline. This can be accomplished by first downloading the target release:
```
uds pull oci://ghcr.io/defenseunicorns/uds-bundle/software-factory-nutanix:0.1.4-amd64
uds pull oci://ghcr.io/defenseunicorns/uds-bundle/software-factory-nutanix:0.1.x --architecture amd64
```

And subsequently deploying from the local file:
Expand All @@ -116,30 +116,19 @@ uds deploy uds-bundle-software-factory-nutanix-amd64-0.1.4.tar.zst --confirm
```

## Additional Notes
For development and testing (both locally and in CI) we have included a Makefile to simplify common tasks. You can follow the breadcrumbs starting at the [Makefile](Makefile) target `make all/dev-cluster`. This Makefile downloads configured versions of zarf and uds to the build directory, places the `uds-config.yaml` in that build directory and performs the deploy command from there. Steps numbered below. Or follow along in the Makefile.
You can use the uds tasks in this project to build and deploy.

These targets will show you how to:
1) download the tools you need like zarf and uds.
```bash
.PHONY: build/zarf
build/zarf: | build ## Download the Zarf to the build dir
if [ -f build/zarf ] && [ "$$(build/zarf version)" = "$(ZARF_VERSION)" ] ; then exit 0; fi && \
echo "Downloading zarf" && \
curl -sL https://github.com/defenseunicorns/zarf/releases/download/$(ZARF_VERSION)/zarf_$(ZARF_VERSION)_$(UNAME_S)_$(ARCH) -o build/zarf && \
chmod +x build/zarf

.PHONY: build/uds
build/uds: | build ## Download uds-cli to the build dir
if [ -f build/uds ] && [ "$$(build/uds version)" = "$(UDS_CLI_VERSION)" ] ; then exit 0; fi && \
echo "Downloading uds-cli" && \
curl -sL https://github.com/defenseunicorns/uds-cli/releases/download/$(UDS_CLI_VERSION)/uds-cli_$(UDS_CLI_VERSION)_$(UNAME_S)_$(ARCH) -o build/uds && \
chmod +x build/uds
```
You can also use brew to install zarf and uds-cli
```bash
brew tap defenseunicorns/tap && brew install uds && brew install zarf
# List the available tasks to run
uds run --list

# Run the create-bundle task
uds run create-bundle

# Run the deploy-bundle-to-dev task
uds run deploy-bundle-to-dev

# Run the deploy-bundle-to-test task
uds run deploy-bundle-to-test
```
2) build all the zarf packages that support this bundle
1) build the bundle itself
1) place the `uds-config.yaml` in the directory where the deployment will take place
1) deploy the software factory.

Loading

0 comments on commit e718536

Please sign in to comment.