From e6759f1f173be7b5ec7d7b6962be62f14436a0ee Mon Sep 17 00:00:00 2001 From: Andrei Kvapil Date: Thu, 25 Dec 2025 16:42:52 +0100 Subject: [PATCH] Rename cozypkg to cozyhr Signed-off-by: Andrei Kvapil --- .github/workflows/release.yml | 1 - README.md | 18 ++++++++++-------- go.mod | 2 +- hack/install.sh | 22 +++++++++++----------- main.go | 30 +++++++++++++++--------------- 5 files changed, 37 insertions(+), 36 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 08e36bd..c121c45 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,6 @@ name: goreleaser on: - pull_request: push: tags: - "v*.*.*" diff --git a/README.md b/README.md index 0c87c3d..2c67957 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 ``` diff --git a/go.mod b/go.mod index 35e9178..5075f6a 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/cozystack/cozypkg +module github.com/cozystack/cozyhr go 1.25.0 diff --git a/hack/install.sh b/hack/install.sh index 3533614..603e3dc 100755 --- a/hack/install.sh +++ b/hack/install.sh @@ -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" @@ -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 @@ -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." diff --git a/main.go b/main.go index a7eee83..4d2c621 100644 --- a/main.go +++ b/main.go @@ -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 ) @@ -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) { @@ -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") @@ -122,7 +122,7 @@ func main() { Use: "version", Short: "Print version", Run: func(_ *cobra.Command, _ []string) { - fmt.Println("cozypkg", Version) + fmt.Println("cozyhr", Version) }, }) @@ -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, ",") @@ -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{} @@ -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 @@ -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 { @@ -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{} @@ -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)) @@ -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) @@ -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) @@ -1072,7 +1072,7 @@ func collectHR( return ulist, nil } -// cmdGet exposes `cozypkg get`. +// cmdGet exposes `cozyhr get`. func cmdGet() *cobra.Command { var ( allNS bool @@ -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 @@ -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