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

[pull] main from cnoe-io:main #4

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a22d504
skip refresh if owned by app set (#354)
nabuskey Aug 5, 2024
a4a4383
Bump Go version to 1.22 (#360)
AryanSharma9917 Aug 19, 2024
78be2c2
Add substitution for aarch64 to installation bash script (#363)
andrew-rosca Aug 26, 2024
385c649
ensure ingress port is available (#368)
nabuskey Aug 27, 2024
3b04b1a
Updated controller tools version (#369)
AryanSharma9917 Aug 27, 2024
d2c4a7a
upgrade ingress-nginx (#373)
nabuskey Aug 28, 2024
4f602a4
run controller gen to update crds (#371)
nabuskey Aug 28, 2024
eab34d6
use kind labels field (#376)
nabuskey Aug 29, 2024
fba981a
Change logging format (#370)
nabuskey Aug 29, 2024
caf882e
ensure ingress-nginx node label is applied (#377)
nabuskey Aug 29, 2024
1284628
update default k8s version to v1.30 (#381)
tapas4java Sep 3, 2024
9bb8d89
Remove replace directives from go.mod (#383)
greghaynes Sep 9, 2024
5c47cf7
Fixes #327: OCI Registry for use with path-based-routing (#313)
jessesanford Sep 16, 2024
5febab5
Added config for gitea to support webhooks trigger (#388)
mmaroth Sep 16, 2024
f0de0f0
run generate command (#390)
nabuskey Sep 17, 2024
f9d4964
Replace the hard coded DNS name of cnoe.localtest.me with {{.Host}} (…
cmoulliard Oct 4, 2024
36c22a1
generate gitea token (#392)
nabuskey Oct 7, 2024
7a9bf83
fail pr action if git is in ditry state (#400)
nabuskey Oct 9, 2024
12229d4
fix typo (#401)
nabuskey Oct 9, 2024
5a13582
Add the missing parameters: answer auto (#403)
cmoulliard Oct 10, 2024
81c61a6
Update readme, removing WIP and adding install info (#404)
greghaynes Oct 14, 2024
1baf788
Bump github.com/docker/docker from 24.0.9+incompatible to 25.0.6+inco…
dependabot[bot] Oct 15, 2024
d966372
fix gitea registry for path based routing (#411)
nabuskey Oct 17, 2024
edaa249
error out when configurations do not match (#418)
nabuskey Oct 17, 2024
1c68879
Workaround for codespaces (#419)
nabuskey Oct 21, 2024
2902af3
use gitea NewClient to catch errors (#427)
nabuskey Oct 24, 2024
a29c580
bump to k8s 0.30.5 (#429)
nabuskey Nov 1, 2024
be892de
add retry for getting credentials (#431)
nabuskey Nov 2, 2024
c90dbd8
ensure kind command outputs are available (#435)
nabuskey Nov 6, 2024
5ecab77
clarify create command flags (#437)
nabuskey Nov 6, 2024
8c6cd97
detect kind provider correctly (#436)
nabuskey Nov 7, 2024
d14289a
print url for codespaces (#456)
nabuskey Nov 20, 2024
4d9f1a0
prevent printing usages on error (#457)
nabuskey Nov 22, 2024
a659417
Updates goreleaser.yaml to mark nightly builds as pre-release (#460)
punkwalker Nov 23, 2024
98b7234
add labels to applications (#461)
nabuskey Nov 25, 2024
03559e6
allow /e2e in PRs to run e2e workflow (#462)
nabuskey Nov 27, 2024
9925fb3
Improve the cmd: get clusters (#449)
cmoulliard Dec 2, 2024
406cc03
handle command interrupt (#455)
nabuskey Dec 4, 2024
6f834bc
Improve the code to print the secrets using printTable (#464)
cmoulliard Dec 24, 2024
57bedf9
fix: e2e test by updating Secret output TemplateData (#467)
punkwalker Jan 3, 2025
6c0467e
Create default passwords when dev mode is set. #441 (#442)
cmoulliard Jan 7, 2025
b8996ee
add configuration steps to create a brew release (#271)
nimakaviani Jan 22, 2025
3b21af9
New command to list the custom packages (#466)
cmoulliard Jan 23, 2025
765404b
Fix wrong import and replace entity with types from printer (#477)
cmoulliard Jan 23, 2025
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
1 change: 1 addition & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ mkdir $HOME/.kube
echo "source <(kubectl completion bash)" >> $HOME/.bashrc
echo "alias k=kubectl" >> $HOME/.bashrc
echo "complete -F __start_kubectl k" >> $HOME/.bashrc
docker network create -d=bridge -o com.docker.network.bridge.enable_ip_masquerade=true -o com.docker.network.driver.mtu=1500 --subnet fc00:f853:ccd:e793::/64 kind
26 changes: 25 additions & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,39 @@ on:
- '**.go'
- 'go.sum'
- 'go.mod'
repository_dispatch:
types: [e2e-command]

jobs:
e2e:
runs-on: ubuntu-22.04
if: ${{ github.event.ref != '' }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: '1.21'
go-version: '1.22'
- name: Run tests
run: |
make e2e
# invoked by slash command workflow
e2e-slash-command:
runs-on: ubuntu-22.04
if: ${{ github.event.action == 'e2e-command' }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
ref: ${{ github.event.client_payload.pull_request.head.ref }}
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: '1.22'
- name: Run tests
run: |
make e2e

7 changes: 6 additions & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ jobs:
- name: Setup Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: '1.21'
go-version: '1.22'
- name: Run tests
run: |
make build
if [[ -n $(git status --porcelain) ]]; then
echo "git is in dirty state";
git status --porcelain=2 --branch
exit 1
fi
make test
9 changes: 8 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- run: git fetch --force --tags
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: '1.21.0'
go-version: '1.22'
- name: Set GORELEASER_PREVIOUS_TAG in actual release
if: ${{ !contains(github.ref, '-nightly') }}
# find previous tag by filtering out nightly tags and choosing the
Expand All @@ -30,6 +30,12 @@ jobs:
- name: build
run: |
OUT_FILE=/tmp/idpbuilder make build
- name: Generate a homebrew tap update token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.CNOE_HOMEBREW_APP_ID }}
private-key: ${{ secrets.CNOE_HOMEBREW_PRIVATE_KEY }}
- name: GoReleaser
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
id: run-goreleaser
Expand All @@ -38,4 +44,5 @@ jobs:
args: release --clean --timeout 30m
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TOKEN: ${{ steps.generate-token.outputs.token }}
GORELEASER_CURRENT_TAG: ${{ github.ref_name }}
24 changes: 24 additions & 0 deletions .github/workflows/slash-commands.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: slash-commands

on:
issue_comment:
types: [created]

jobs:
slash_command_dispatch:
runs-on: ubuntu-22.04
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.CNOE_GH_WORKFLOW_TOKEN_APP_ID }}
private-key: ${{ secrets.CNOE_GH_WORKFLOW_TOKEN_PRIVATE_KEY }}
- name: Slash Command Dispatch
uses: peter-evans/slash-command-dispatch@v4
with:
token: ${{ steps.generate-token.outputs.token }}
commands: |
e2e
permission: write
issue-type: pull-request
21 changes: 20 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ project_name: idpbuilder
before:
hooks:
- go mod tidy
release:
# Mark nightly build as prerelease based on tag
prerelease: '{{ contains .Tag "-nightly" }}'

builds:
- env:
- CGO_ENABLED=0
Expand All @@ -22,14 +26,29 @@ builds:
ignore:
- goos: linux
goarch: '386'
brews:
- name: idpbuilder
homepage: "https://cnoe.io"
repository:
owner: cnoe-io
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TOKEN }}"
commit_author:
name: "CNOEAutomation"
email: "[email protected]"
directory: formula
install: |
bin.install "idpbuilder"
test: |
system "#{bin}/idpbuilder --version"
archives:
- format: tar.gz
name_template: >-
{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
version_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ HELM_TGZ ?= $(LOCALBIN)/helm.tar.gz
HELM ?= $(LOCALBIN)/helm

## Tool Versions
CONTROLLER_TOOLS_VERSION ?= v0.14.0
CONTROLLER_TOOLS_VERSION ?= v0.15.0

.PHONY: fmt
fmt: ## Run go fmt against code.
Expand Down
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

Internal development platform binary launcher.

> **WORK IN PROGRESS**: This tool is in a pre-release stage and is under active development.

## About

Spin up a complete internal developer platform using industry standard technologies like Kubernetes, Argo, and backstage with only Docker required as a dependency.
Expand All @@ -20,7 +18,25 @@ This can be useful in several ways:

## Getting Started

Checkout our [documentation website](https://cnoe.io/docs/reference-implementation/installations/idpbuilder) for getting started with idpbuilder.
The easiest way to get started is to grab the idpbuilder binary for your platform and run it. You can visit our [nightly releases](https://github.com/cnoe-io/idpbuilder/releases/latest) page to download the version for your system, or run the following commands:

```bash
arch=$(if [[ "$(uname -m)" == "x86_64" ]]; then echo "amd64"; else uname -m; fi)
os=$(uname -s | tr '[:upper:]' '[:lower:]')


idpbuilder_latest_tag=$(curl --silent "https://api.github.com/repos/cnoe-io/idpbuilder/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
curl -LO https://github.com/cnoe-io/idpbuilder/releases/download/$idpbuilder_latest_tag/idpbuilder-$os-$arch.tar.gz
tar xvzf idpbuilder-$os-$arch.tar.gz
```

You can then run idpbuilder with the create argument to spin up your CNOE IDP:

```bash
./idpbuilder create
```

For more detailed information, checkout our [documentation website](https://cnoe.io/docs/reference-implementation/installations/idpbuilder) on getting started with idpbuilder.

## Community

Expand Down
23 changes: 19 additions & 4 deletions api/v1alpha1/localbuild_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ const (
CliStartTimeAnnotation = "cnoe.io/cli-start-time"
FieldManager = "idpbuilder"
// If GetSecretLabelKey is set to GetSecretLabelValue on a kubernetes secret, secret key and values can be used by the get command.
CLISecretLabelKey = "cnoe.io/cli-secret"
CLISecretLabelValue = "true"
PackageNameLabelKey = "cnoe.io/package-name"
CLISecretLabelKey = "cnoe.io/cli-secret"
CLISecretLabelValue = "true"
PackageNameLabelKey = "cnoe.io/package-name"
PackageTypeLabelKey = "cnoe.io/package-type"
PackageTypeLabelCore = "core"
PackageTypeLabelCustom = "custom"

ArgoCDPackageName = "argocd"
GiteaPackageName = "gitea"
Expand Down Expand Up @@ -45,8 +48,20 @@ type PackageConfigsSpec struct {
CorePackageCustomization map[string]PackageCustomization `json:"packageCustomization,omitempty"`
}

// BuildCustomizationSpec fields cannot change once a cluster is created
type BuildCustomizationSpec struct {
Protocol string `json:"protocol,omitempty"`
Host string `json:"host,omitempty"`
IngressHost string `json:"ingressHost,omitempty"`
Port string `json:"port,omitempty"`
UsePathRouting bool `json:"usePathRouting,omitempty"`
SelfSignedCert string `json:"selfSignedCert,omitempty"`
StaticPassword bool `json:"staticPassword,omitempty"`
}

type LocalbuildSpec struct {
PackageConfigs PackageConfigsSpec `json:"packageConfigs,omitempty"`
PackageConfigs PackageConfigsSpec `json:"packageConfigs,omitempty"`
BuildCustomization BuildCustomizationSpec `json:"buildCustomization,omitempty"`
}

// PackageCustomization defines how packages are customized
Expand Down
16 changes: 16 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading