mirror of
https://github.com/luxfi/lpm.git
synced 2026-10-30 16:20:57 +00:00
Lux Partners Limited is the Isle of Man company. Lux Industries Inc, a Delaware C corporation, is the company these sites belong to, so it is the one they name — in metadata, copyright, and the press items that record who signed. The fund site names Lux Assets Management LLC, which is its own company. Two sentences were rewritten rather than renamed, because a name was doing work a name cannot do. One claimed an Isle of Man domicile the naming entity does not have. The other said a company acts on behalf of another; with one entity left it said a company acts on behalf of itself. The Isle of Man stays everywhere it is a JURISDICTION the product supports — the regulatory package, the jurisdiction guides, the compliance tables. Only this company's own identity changed.
83 lines
2.2 KiB
Go
83 lines
2.2 KiB
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"runtime"
|
|
"strings"
|
|
|
|
"github.com/spf13/afero"
|
|
"github.com/spf13/cobra"
|
|
"github.com/spf13/viper"
|
|
|
|
"github.com/luxfi/lpm/workflow"
|
|
)
|
|
|
|
func installGitlab(fs afero.Fs) *cobra.Command {
|
|
var (
|
|
vmid string
|
|
tag string
|
|
pattern string
|
|
gitlabURL string
|
|
token string
|
|
)
|
|
|
|
cmd := &cobra.Command{
|
|
Use: "install-gitlab <owner/repo>",
|
|
Short: "Install a VM plugin binary from a GitLab release",
|
|
Long: `Download and install a pre-compiled VM plugin binary from GitLab releases.
|
|
|
|
Supports gitlab.com and self-hosted GitLab instances.
|
|
Automatically detects the correct binary for your platform (OS/arch).
|
|
|
|
Examples:
|
|
# Install latest release from gitlab.com
|
|
lpm install-gitlab myorg/myvm
|
|
|
|
# Install specific version
|
|
lpm install-gitlab myorg/myvm --tag v1.0.0
|
|
|
|
# Self-hosted GitLab
|
|
lpm install-gitlab myorg/myvm --gitlab-url https://gitlab.example.com
|
|
|
|
# Private repository
|
|
lpm install-gitlab myorg/myvm --token glpat-xxxxxxxxxxxxxxxxxxxx`,
|
|
Args: cobra.ExactArgs(1),
|
|
RunE: func(_ *cobra.Command, args []string) error {
|
|
repo := args[0]
|
|
parts := strings.SplitN(repo, "/", 2)
|
|
if len(parts) != 2 {
|
|
return fmt.Errorf("invalid repo: %s (expected owner/repo)", repo)
|
|
}
|
|
|
|
pluginDir := viper.GetString(pluginPathKey)
|
|
|
|
wf := workflow.NewInstallGitLab(workflow.InstallGitLabConfig{
|
|
Owner: parts[0],
|
|
Repo: parts[1],
|
|
Tag: tag,
|
|
VMID: vmid,
|
|
Pattern: pattern,
|
|
OS: runtime.GOOS,
|
|
Arch: runtime.GOARCH,
|
|
PluginDir: pluginDir,
|
|
BaseURL: gitlabURL,
|
|
Token: token,
|
|
Fs: fs,
|
|
})
|
|
|
|
return wf.Execute()
|
|
},
|
|
}
|
|
|
|
cmd.Flags().StringVar(&vmid, "vmid", "", "VM ID (auto-detected from repo name if not set)")
|
|
cmd.Flags().StringVar(&tag, "tag", "", "Release tag (default: latest)")
|
|
cmd.Flags().StringVar(&pattern, "pattern", "", "Binary name pattern (default: auto-detect)")
|
|
cmd.Flags().StringVar(&gitlabURL, "gitlab-url", "", "GitLab instance URL (default: https://gitlab.com)")
|
|
cmd.Flags().StringVar(&token, "token", "", "GitLab private token for authentication")
|
|
|
|
return cmd
|
|
}
|