Skip to content

Commit

Permalink
update build and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
AJ ONeal committed Dec 2, 2020
1 parent 32c71bd commit f3ab547
Show file tree
Hide file tree
Showing 45 changed files with 230 additions and 4,741 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/serviceman
/manager/static/ab0x.go
dist
xversion.go

*~
.*~
# ---> Go
Expand Down
36 changes: 36 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
before:
hooks:
- go mod download
- go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- 386
- amd64
- arm
- arm64
goarm:
- 6
- 7
archives:
- replacements:
386: i386
amd64: x86_64
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: '{{ .Tag }}-next'
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module git.rootprojects.org/root/go-serviceman
module git.rootprojects.org/root/serviceman

go 1.12

require (
git.rootprojects.org/root/go-gitver v1.1.2
git.rootprojects.org/root/go-gitver/v2 v2.0.2
github.com/UnnoTed/fileb0x v1.1.3
github.com/mitchellh/go-ps v0.0.0-20170309133038-4fdf99ab2936
golang.org/x/net v0.0.0-20180921000356-2f5d2388922f
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
git.rootprojects.org/root/go-gitver v1.1.2 h1:AQhr8ktJyP+X+jFbtLavCi/FQLSmB6xvdG2Nfp+J2JA=
git.rootprojects.org/root/go-gitver v1.1.2/go.mod h1:Rj1v3TBhvdaSphFEqMynUYwAz/4f+wY/+syBTvRrmlI=
git.rootprojects.org/root/go-gitver/v2 v2.0.2 h1:T+Je13wrY1jz4OPJF98HnuCNp6n2Xe2uK6/NNF6a4+0=
git.rootprojects.org/root/go-gitver/v2 v2.0.2/go.mod h1:ur82M/jZcvr1WWihyVtNEgDBqIjo22o56wcVHeVJFh8=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/UnnoTed/fileb0x v1.1.3 h1:TUfJRey+psXuivBqasgp7Du3iXB4hzjI5UXDl+BCrzE=
Expand Down
2 changes: 1 addition & 1 deletion manager/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"path/filepath"
"strings"

"git.rootprojects.org/root/go-serviceman/service"
"git.rootprojects.org/root/serviceman/service"
)

// Install will do a best-effort attempt to install a start-on-startup
Expand Down
4 changes: 2 additions & 2 deletions manager/install_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"path/filepath"
"text/template"

"git.rootprojects.org/root/go-serviceman/manager/static"
"git.rootprojects.org/root/go-serviceman/service"
"git.rootprojects.org/root/serviceman/manager/static"
"git.rootprojects.org/root/serviceman/service"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions manager/install_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"path/filepath"
"text/template"

"git.rootprojects.org/root/go-serviceman/manager/static"
"git.rootprojects.org/root/go-serviceman/service"
"git.rootprojects.org/root/serviceman/manager/static"
"git.rootprojects.org/root/serviceman/service"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion manager/install_nixes.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"path/filepath"
"strings"

"git.rootprojects.org/root/go-serviceman/service"
"git.rootprojects.org/root/serviceman/service"
)

// this code is shared between Mac and Linux, but may diverge in the future
Expand Down
2 changes: 1 addition & 1 deletion manager/install_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package manager

import (
"git.rootprojects.org/root/go-serviceman/service"
"git.rootprojects.org/root/serviceman/service"
)

func Render(c *service.Service) ([]byte, error) {
Expand Down
4 changes: 2 additions & 2 deletions manager/install_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"path/filepath"
"strings"

"git.rootprojects.org/root/go-serviceman/runner"
"git.rootprojects.org/root/go-serviceman/service"
"git.rootprojects.org/root/serviceman/runner"
"git.rootprojects.org/root/serviceman/service"

"golang.org/x/sys/windows/registry"
)
Expand Down
4 changes: 2 additions & 2 deletions manager/static/ab0x.go

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

2 changes: 1 addition & 1 deletion runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"time"

"git.rootprojects.org/root/go-serviceman/service"
"git.rootprojects.org/root/serviceman/service"

ps "github.com/mitchellh/go-ps"
)
Expand Down
33 changes: 25 additions & 8 deletions serviceman.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:generate go run -mod=vendor git.rootprojects.org/root/go-gitver
//go:generate go run -mod=vendor git.rootprojects.org/root/go-gitver/v2

// main runs the things and does the stuff
package main
Expand All @@ -16,14 +16,23 @@ import (
"time"
"unicode/utf8"

"git.rootprojects.org/root/go-serviceman/manager"
"git.rootprojects.org/root/go-serviceman/runner"
"git.rootprojects.org/root/go-serviceman/service"
"git.rootprojects.org/root/serviceman/manager"
"git.rootprojects.org/root/serviceman/runner"
"git.rootprojects.org/root/serviceman/service"
)

var GitRev = "000000000"
var GitVersion = "v0.5.3-pre+dirty"
var GitTimestamp = time.Now().Format(time.RFC3339)
var (
// commit refers to the abbreviated commit hash
commit = "0000000"
// version refers to the most recent tag, plus any commits made since then
version = "v0.0.0-pre0+0000000"
// date refers to the timestamp of the most recent commit
date = time.Now().Format(time.RFC3339)
)

func ver() string {
return fmt.Sprintf("serviceman %s (%s) %s", version, commit[:7], date)
}

func usage() {
fmt.Println("Usage:")
Expand All @@ -36,6 +45,14 @@ func usage() {
}

func main() {
if len(os.Args) >= 2 {
if "version" == strings.TrimLeft(os.Args[1], "-") {
fmt.Printf("%s\n", ver())
os.Exit(0)
return
}
}

if len(os.Args) < 2 {
fmt.Fprintf(os.Stderr, "Too few arguments: %s\n", strings.Join(os.Args, " "))
usage()
Expand All @@ -46,7 +63,7 @@ func main() {
os.Args = append(os.Args[:1], os.Args[2:]...)
switch top {
case "version":
fmt.Println(GitVersion, GitTimestamp, GitRev)
fmt.Println(ver())
case "run":
run()
case "add":
Expand Down
2 changes: 1 addition & 1 deletion serviceman_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"git.rootprojects.org/root/go-serviceman/service"
"git.rootprojects.org/root/serviceman/service"
)

func printLogMessage(conf *service.Service) {
Expand Down
4 changes: 2 additions & 2 deletions serviceman_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main
import (
"fmt"

"git.rootprojects.org/root/go-serviceman/manager"
"git.rootprojects.org/root/go-serviceman/service"
"git.rootprojects.org/root/serviceman/manager"
"git.rootprojects.org/root/serviceman/service"
)

func printLogMessage(conf *service.Service) {
Expand Down
2 changes: 1 addition & 1 deletion serviceman_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"git.rootprojects.org/root/go-serviceman/service"
"git.rootprojects.org/root/serviceman/service"
)

func printLogMessage(conf *service.Service) {
Expand Down
2 changes: 1 addition & 1 deletion tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
package tools

import (
_ "git.rootprojects.org/root/go-gitver"
_ "git.rootprojects.org/root/go-gitver/v2"
_ "github.com/UnnoTed/fileb0x"
)
3 changes: 0 additions & 3 deletions vendor/git.rootprojects.org/root/go-gitver/go.mod

This file was deleted.

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

1 change: 1 addition & 0 deletions vendor/git.rootprojects.org/root/go-gitver/v2/.prettierrc

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

Loading

0 comments on commit f3ab547

Please sign in to comment.