Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Commit

Permalink
updates from hofmod-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
verdverm committed Apr 27, 2020
1 parent 08d9c46 commit 802fb3a
Show file tree
Hide file tree
Showing 8 changed files with 259 additions and 197 deletions.
97 changes: 0 additions & 97 deletions .hof/Cli/.goreleaser.yml

This file was deleted.

24 changes: 12 additions & 12 deletions .goreleaser.yml → .hof/Cli/cmd/mvs/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ builds:

ldflags:
- -s -w
- -X github.com/hofstadter-io/mvs/commands.Version={{.Version}}
- -X github.com/hofstadter-io/mvs/commands.Commit={{.FullCommit}}
- -X github.com/hofstadter-io/mvs/commands.BuildDate={{.Date}}
- -X github.com/hofstadter-io/mvs/commands.GoVersion=go1.14
- -X github.com/hofstadter-io/mvs/commands.BuildOS={{.Os}}
- -X github.com/hofstadter-io/mvs/commands.BuildArch={{.Arch}}
- -X github.com/hofstadter-io/mvs/commands.BuildArm={{.Arm}}
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.Version={{.Version}}
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.Commit={{.FullCommit}}
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.BuildDate={{.Date}}
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.GoVersion=go1.14
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.BuildOS={{.Os}}
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.BuildArch={{.Arch}}
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.BuildArm={{.Arm}}

env:
- CGO_ENABLED=0
Expand Down Expand Up @@ -63,16 +63,16 @@ changelog:


release:
disable: false
draft: false
disable: true
draft: true
github:
owner: hofstadter-io
name: mvs

dockers:
- binaries:
- mvs
skip_push: false
skip_push: true
dockerfile: ci/docker/Dockerfile.jessie
image_templates:
- "hofstadter/{{.ProjectName}}:{{.Tag}}"
Expand All @@ -88,10 +88,10 @@ dockers:

- binaries:
- mvs
skip_push: false
skip_push: true
dockerfile: ci/docker/Dockerfile.scratch
image_templates:
- "hofstadter/{{.ProjectName}}:{{.Tag}}-scratch"
- "hofstadter/{{.ProjectName}}:v{{ .Major }}.{{ .Minor }}-scratch"
- "hofstadter/{{.ProjectName}}:v{{ .Major }}-scratch"
- "hofstadter/{{.ProjectName}}:latest-scratch"
- "hofstadter/{{.ProjectName}}:latest-scratch"
42 changes: 0 additions & 42 deletions .hof/Cli/cmd/mvs/cmd/bash-completion.go

This file was deleted.

74 changes: 74 additions & 0 deletions .hof/Cli/cmd/mvs/cmd/completions.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package cmd

import (
"os"

"github.com/spf13/cobra"
)

var CompletionCmd = &cobra.Command{
Use: "completion",
Aliases: []string{"completions"},
Short: "Generate completion helpers for your terminal",
Long: "Generate completion helpers for your terminal",
}

var BashCompletionLong = `Generate Bash completions
To load completion run
. <(mvs completion bash)
To configure your bash shell to load completions for each session add to your bashrc
# ~/.bashrc or ~/.profile
. <(mvs completion bash)
`

var BashCompletionCmd = &cobra.Command{
Use: "bash",
Short: "Generate Bash completions",
Long: BashCompletionLong,
Run: func(cmd *cobra.Command, args []string) {
RootCmd.GenBashCompletion(os.Stdout)
},
}

var ZshCompletionCmd = &cobra.Command{
Use: "zsh",
Short: "Generate Zsh completions",
Long: "Generate Zsh completions",
Run: func(cmd *cobra.Command, args []string) {
RootCmd.GenZshCompletion(os.Stdout)
},
}

var FishCompletionCmd = &cobra.Command{
Use: "fish",
Short: "Generate Fish completions",
Long: "Generate Fish completions",

Run: func(cmd *cobra.Command, args []string) {
RootCmd.GenZshCompletion(os.Stdout)
},
}

var PowerShellCompletionCmd = &cobra.Command{
Use: "power-shell",
Aliases: []string{"windows", "win", "power", "ps"},
Short: "Generate PowerShell completions",
Long: "Generate PowerShell completions",

Run: func(cmd *cobra.Command, args []string) {
RootCmd.GenPowerShellCompletion(os.Stdout)
},
}

func init() {
CompletionCmd.AddCommand(BashCompletionCmd)
CompletionCmd.AddCommand(ZshCompletionCmd)
CompletionCmd.AddCommand(FishCompletionCmd)
CompletionCmd.AddCommand(PowerShellCompletionCmd)

RootCmd.AddCommand(CompletionCmd)
}
6 changes: 2 additions & 4 deletions cli.cue
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ HofGenCli: gen.#HofGenerator & {
"""

Releases: schema.#GoReleaser & {
Disabled: false
Draft: false
Disabled: true
Draft: true
Author: "Tony Worm"
Homepage: "https://github.com/hofstadter-io/mvs"

Expand All @@ -57,8 +57,6 @@ HofGenCli: gen.#HofGenerator & {
}
}

GenCmdLib: true

OmitRun: true

Imports: [
Expand Down
97 changes: 97 additions & 0 deletions cmd/mvs/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
project_name: "mvs"

before:
hooks:
- go mod vendor

builds:
- binary: "mvs"
main: main.go

ldflags:
- -s -w
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.Version={{.Version}}
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.Commit={{.FullCommit}}
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.BuildDate={{.Date}}
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.GoVersion=go1.14
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.BuildOS={{.Os}}
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.BuildArch={{.Arch}}
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.BuildArm={{.Arm}}

env:
- CGO_ENABLED=0

goos:
- darwin
- linux
- windows
goarch:
- amd64
- arm64
- arm

ignore:
- goos: linux
goarch: arm


snapshot:
name_template: "{{ .Tag }}-SNAPSHOT-{{.ShortCommit}}"

archives:
- format: binary
replacements:
darwin: Darwin
linux: Linux
windows: Windows
amd64: x86_64
# Needed hack for binary only uploads
# For more information, check #602
files:
- "thisfiledoesnotexist*"


checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt'

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'


release:
disable: true
draft: true
github:
owner: hofstadter-io
name: mvs

dockers:
- binaries:
- mvs
skip_push: true
dockerfile: ci/docker/Dockerfile.jessie
image_templates:
- "hofstadter/{{.ProjectName}}:{{.Tag}}"
- "hofstadter/{{.ProjectName}}:v{{ .Major }}.{{ .Minor }}"
- "hofstadter/{{.ProjectName}}:v{{ .Major }}"
- "hofstadter/{{.ProjectName}}:latest"

- "hofstadter/{{.ProjectName}}:{{.Tag}}-debian"
- "hofstadter/{{.ProjectName}}:v{{ .Major }}.{{ .Minor }}-debian"
- "hofstadter/{{.ProjectName}}:v{{ .Major }}-debian"
- "hofstadter/{{.ProjectName}}:latest-debian"


- binaries:
- mvs
skip_push: true
dockerfile: ci/docker/Dockerfile.scratch
image_templates:
- "hofstadter/{{.ProjectName}}:{{.Tag}}-scratch"
- "hofstadter/{{.ProjectName}}:v{{ .Major }}.{{ .Minor }}-scratch"
- "hofstadter/{{.ProjectName}}:v{{ .Major }}-scratch"
- "hofstadter/{{.ProjectName}}:latest-scratch"
Loading

0 comments on commit 802fb3a

Please sign in to comment.