Skip to content
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
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: goreleaser

on:
pull_request:
push:
tags:
- "v*.*.*"
Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# cozypkg
# cozyhr

> **Note:** This project was formerly known as `cozypkg`.

Cozy wrapper around Helm and Flux CD for local development

## Usage

**cozypkg** assumes that you run it from the local directory that contains your Helm chart.
**cozyhr** assumes that you run it from the local directory that contains your Helm chart.
All relative paths and operations are resolved against this working directory.

```
Cozy wrapper around Helm and Flux CD for local development

Usage:
cozypkg [command]
cozyhr [command]

Available Commands:
apply Upgrade or install HelmRelease and sync status
Expand All @@ -28,19 +30,19 @@ Available Commands:
version Print version

Flags:
-h, --help help for cozypkg
-h, --help help for cozyhr
--kubeconfig string Path to kubeconfig
-n, --namespace string Kubernetes namespace (defaults to the current context)
-v, --version version for cozypkg
-v, --version version for cozyhr

Use "cozypkg [command] --help" for more information about a command.
Use "cozyhr [command] --help" for more information about a command.
```

## Installation

Download binary from Github [releases page](https://github.com/cozystack/cozypkg/releases/latest)
Download binary from Github [releases page](https://github.com/cozystack/cozyhr/releases/latest)

Or use simple script to install it:
```bash
curl -sSL https://github.com/cozystack/cozypkg/raw/refs/heads/main/hack/install.sh | sh -s
curl -sSL https://github.com/cozystack/cozyhr/raw/refs/heads/main/hack/install.sh | sh -s
```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/cozystack/cozypkg
module github.com/cozystack/cozyhr

go 1.25.0

Expand Down
22 changes: 11 additions & 11 deletions hack/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,20 @@ case "$ARCH" in
*) error "Unsupported architecture: $ARCH" ;;
esac

TAR_FILE="cozypkg-$OS-$ARCH.tar.gz"
CHECKSUM_FILE="cozypkg-checksums.txt"
TAR_FILE="cozyhr-$OS-$ARCH.tar.gz"
CHECKSUM_FILE="cozyhr-checksums.txt"

if [ "$TAG" = "latest" ]; then
BASE_URL="https://github.com/cozystack/cozypkg/releases/latest/download"
BASE_URL="https://github.com/cozystack/cozyhr/releases/latest/download"
else
BASE_URL="https://github.com/cozystack/cozypkg/releases/download/$TAG"
BASE_URL="https://github.com/cozystack/cozyhr/releases/download/$TAG"
fi

TMPDIR=$(mktemp -d)
cleanup() { rm -rf "$TMPDIR"; }
trap cleanup EXIT INT TERM

info "Installing cozypkg version: $TAG"
info "Installing cozyhr version: $TAG"
info "Downloading $TAR_FILE..."
download "$TMPDIR/$TAR_FILE" "$BASE_URL/$TAR_FILE" || error "Failed to download $TAR_FILE"

Expand All @@ -106,9 +106,9 @@ success "Checksum verified."
info "Extracting..."
tar -xzf "$TMPDIR/$TAR_FILE" -C "$TMPDIR"

[ -f "$TMPDIR/cozypkg" ] || error "Binary 'cozypkg' not found in archive."
[ -f "$TMPDIR/cozyhr" ] || error "Binary 'cozyhr' not found in archive."

chmod +x "$TMPDIR/cozypkg"
chmod +x "$TMPDIR/cozyhr"

# Determine install dir
if [ "$(id -u)" = "0" ] || [ -w "/usr/local/bin" ]; then
Expand All @@ -122,9 +122,9 @@ else
esac
fi

INSTALL_PATH="$INSTALL_DIR/cozypkg"
INSTALL_PATH="$INSTALL_DIR/cozyhr"

mv "$TMPDIR/cozypkg" "$INSTALL_PATH"
mv "$TMPDIR/cozyhr" "$INSTALL_PATH"

success "cozypkg installed successfully at $INSTALL_PATH"
info "Run 'cozypkg --help' to get started."
success "cozyhr installed successfully at $INSTALL_PATH"
info "Run 'cozyhr --help' to get started."
30 changes: 15 additions & 15 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ var (
ns string
chDir string
plain bool // render without talking to the API server
showOnly []string // template globs for `cozypkg show`
showOnly []string // template globs for `cozyhr show`
extraVals []string // additional -f/--values files
)

Expand All @@ -84,7 +84,7 @@ func main() {
log.SetFlags(0)

root := &cobra.Command{
Use: "cozypkg",
Use: "cozyhr",
Short: "Cozy wrapper around Helm and Flux CD for local development",
Version: Version,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
Expand All @@ -96,7 +96,7 @@ func main() {
}
},
}
root.SetVersionTemplate("cozypkg version {{.Version}}\n")
root.SetVersionTemplate("cozyhr version {{.Version}}\n")

root.PersistentFlags().StringVar(&kubeconfig, "kubeconfig", "", "Path to kubeconfig")
root.PersistentFlags().StringVar(&kubecontext, "context", "", "Kube context")
Expand All @@ -122,7 +122,7 @@ func main() {
Use: "version",
Short: "Print version",
Run: func(_ *cobra.Command, _ []string) {
fmt.Println("cozypkg", Version)
fmt.Println("cozyhr", Version)
},
})

Expand Down Expand Up @@ -391,7 +391,7 @@ func mergedValues(ctx context.Context, cl client.Client, hr *v2.HelmRelease, cha

// First, try to get valuesFiles from annotation (set by operator)
if ann := hr.GetAnnotations(); ann != nil {
if vfStr, ok := ann["cozypkg.cozystack.io/values-files"]; ok {
if vfStr, ok := ann["cozyhr.cozystack.io/values-files"]; ok {
// Format: comma-separated string, e.g., "values.yaml,values-cilium.yaml"
if vfStr != "" {
valuesFiles = strings.Split(vfStr, ",")
Expand Down Expand Up @@ -641,7 +641,7 @@ func cmdFactory(name string, fn runFn) *cobra.Command {
return cmd
}

// cmdShow returns the `cozypkg show` command.
// cmdShow returns the `cozyhr show` command.
func cmdShow() *cobra.Command {
cmd := cmdFactory("show", func(ctx context.Context, cl client.Client, cfg *helmaction.Configuration, hr *v2.HelmRelease, chartDir string) error {
var vals map[string]interface{}
Expand Down Expand Up @@ -709,7 +709,7 @@ func cmdShow() *cobra.Command {
return cmd
}

// cmdApply returns the `cozypkg apply` command.
// cmdApply returns the `cozyhr apply` command.
func cmdApply() *cobra.Command {
var autoResume bool
var takeOwnership bool
Expand All @@ -720,7 +720,7 @@ func cmdApply() *cobra.Command {

bc := record.NewBroadcaster()
defer bc.Shutdown()
rec := bc.NewRecorder(clientsetscheme.Scheme, corev1.EventSource{Component: "cozypkg"})
rec := bc.NewRecorder(clientsetscheme.Scheme, corev1.EventSource{Component: "cozyhr"})
vals := map[string]interface{}{}

if !plain {
Expand Down Expand Up @@ -783,7 +783,7 @@ func cmdApply() *cobra.Command {
return cmd
}

// cmdDiff returns the `cozypkg diff` command.
// cmdDiff returns the `cozyhr diff` command.
func cmdDiff() *cobra.Command {
cmd := cmdFactory("diff", func(ctx context.Context, cl client.Client, cfg *helmaction.Configuration, hr *v2.HelmRelease, chartDir string) error {
var vals map[string]interface{}
Expand Down Expand Up @@ -817,7 +817,7 @@ func cmdDiff() *cobra.Command {
return cmd
}

// cmdSuspend returns the `cozypkg suspend` command.
// cmdSuspend returns the `cozyhr suspend` command.
func cmdSuspend() *cobra.Command {
cmd := cmdFactory("suspend", func(ctx context.Context, cl client.Client, _ *helmaction.Configuration, hr *v2.HelmRelease, _ string) error {
return patchSuspend(ctx, cl, hr.Namespace, hr.Name, pointer.Bool(true))
Expand All @@ -826,7 +826,7 @@ func cmdSuspend() *cobra.Command {
return cmd
}

// cmdResume returns the `cozypkg resume` command.
// cmdResume returns the `cozyhr resume` command.
func cmdResume() *cobra.Command {
cmd := cmdFactory("resume", func(ctx context.Context, cl client.Client, _ *helmaction.Configuration, hr *v2.HelmRelease, _ string) error {
return patchSuspend(ctx, cl, hr.Namespace, hr.Name, nil)
Expand All @@ -835,7 +835,7 @@ func cmdResume() *cobra.Command {
return cmd
}

// cmdDelete returns the `cozypkg delete` command.
// cmdDelete returns the `cozyhr delete` command.
func cmdDelete() *cobra.Command {
cmd := cmdFactory("delete", func(_ context.Context, _ client.Client, cfg *helmaction.Configuration, hr *v2.HelmRelease, _ string) error {
un := helmaction.NewUninstall(cfg)
Expand Down Expand Up @@ -1072,7 +1072,7 @@ func collectHR(
return ulist, nil
}

// cmdGet exposes `cozypkg get`.
// cmdGet exposes `cozyhr get`.
func cmdGet() *cobra.Command {
var (
allNS bool
Expand All @@ -1092,7 +1092,7 @@ func cmdGet() *cobra.Command {
return cmd
}

// cmdList exposes `cozypkg list` (alias: ls).
// cmdList exposes `cozyhr list` (alias: ls).
func cmdList() *cobra.Command {
var (
allNS bool
Expand Down Expand Up @@ -1306,7 +1306,7 @@ func completeHelmReleases(cmd *cobra.Command, args []string, toComplete string)
return out, cobra.ShellCompDirectiveNoFileComp
}

// cmdReconcile returns the `cozypkg reconcile` command.
// cmdReconcile returns the `cozyhr reconcile` command.
func cmdReconcile() *cobra.Command {
var (
withSource bool
Expand Down