Skip to content

Commit

Permalink
Merge pull request #693 from CircleCI-Public/remove-packr
Browse files Browse the repository at this point in the history
Remove uses of packr
  • Loading branch information
ruben1 authored May 5, 2022
2 parents 18585af + 13cb286 commit 0eca3cd
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 499 deletions.
46 changes: 0 additions & 46 deletions .circleci/install-packr.sh

This file was deleted.

38 changes: 0 additions & 38 deletions .circleci/pack.sh

This file was deleted.

4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ snap/.snapcraft/
stage/
*.snap

# packr related
*/*-packr.go
packrd/

# golangci-lint
# We expect to install the binary each time in CI
bin/golangci-lint
Expand Down
4 changes: 0 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ archives:
- api/graphql/LICENSE
- md_docs/LICENSE

before:
hooks:
- make pack

builds:
- binary: circleci
env:
Expand Down
10 changes: 0 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ GOOS=$(shell go env GOOS)
GOARCH=$(shell go env GOARCH)

build: always
GO111MODULE=on .circleci/pack.sh
go build -o build/$(GOOS)/$(GOARCH)/circleci

build-all: build/linux/amd64/circleci build/darwin/amd64/circleci
Expand All @@ -16,7 +15,6 @@ build/%/amd64/circleci: always
clean:
GO111MODULE=off go clean -i
rm -rf build out docs dist
.circleci/pack.sh clean

.PHONY: test
test:
Expand All @@ -34,14 +32,6 @@ lint:
doc:
godoc -http=:6060

.PHONY: install-packr
install-packr:
bash .circleci/install-packr.sh

.PHONY: pack
pack:
bash .circleci/pack.sh

.PHONY: install-lint
install-lint:
bash .circleci/install-lint.sh
Expand Down
9 changes: 0 additions & 9 deletions _data/data.yml

This file was deleted.

Empty file removed bin/.gitkeep
Empty file.
Binary file removed bin/darwin_386/packr2
Binary file not shown.
Binary file removed bin/darwin_amd64/packr2
Binary file not shown.
Binary file removed bin/linux_386/packr2
Binary file not shown.
Binary file removed bin/linux_amd64/packr2
Binary file not shown.
6 changes: 1 addition & 5 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@ func MakeCommands() *cobra.Command {
panic(err)
}

loaded, err := data.LoadData()
if err != nil {
panic(err)
}
rootOptions.Data = loaded
rootOptions.Data = &data.Data

rootCmd = &cobra.Command{
Use: "circleci",
Expand Down
48 changes: 15 additions & 33 deletions data/data.go
Original file line number Diff line number Diff line change
@@ -1,39 +1,21 @@
package data

import (
packr "github.com/gobuffalo/packr/v2"
"gopkg.in/yaml.v3"
)

// YML maps the YAML found in _data/data.yml
// Be sure to update this type when you modify the structure of that file!
type YML struct {
type DataBag struct {
Links struct {
CLIDocs string `yaml:"cli_docs"`
OrbDocs string `yaml:"orb_docs"`
NewAPIToken string `yaml:"new_api_token"`
} `yaml:"links"`
}

// LoadData should be called once to decode the YAML into YML.
func LoadData() (*YML, error) {
var (
bts []byte
err error
)

d := &YML{}
box := packr.New("circleci-cli-box", "../_data")

bts, err = box.Find("data.yml")
if err != nil {
return nil, err
}

err = yaml.Unmarshal(bts, &d)
if err != nil {
return nil, err
CLIDocs string
OrbDocs string
NewAPIToken string
}
}

return d, nil
var Data = DataBag{
Links: struct {
CLIDocs string
OrbDocs string
NewAPIToken string
}{
CLIDocs: "https://circleci.com/docs/2.0/local-cli/",
OrbDocs: "https://circleci.com/docs/2.0/orb-intro/",
NewAPIToken: "https://circleci.com/account/api",
},
}
22 changes: 1 addition & 21 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ require (
github.com/briandowns/spinner v0.0.0-20181018151057-dd69c579ff20
github.com/fatih/color v1.9.0 // indirect
github.com/go-git/go-git/v5 v5.1.0
github.com/gobuffalo/buffalo-plugins v1.9.3 // indirect
github.com/gobuffalo/flect v0.0.0-20181210151238-24a2b68e0316 // indirect
github.com/gobuffalo/packr/v2 v2.0.0-rc.13
github.com/google/go-github v15.0.0+incompatible // indirect
github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135 // indirect
github.com/google/uuid v1.3.0
Expand All @@ -33,45 +30,28 @@ require (
)

require (
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/fsnotify/fsnotify v1.4.7 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.0.0 // indirect
github.com/gobuffalo/envy v1.6.11 // indirect
github.com/gobuffalo/events v1.1.8 // indirect
github.com/gobuffalo/genny v0.0.0-20181211165820-e26c8466f14d // indirect
github.com/gobuffalo/logger v0.0.0-20181127160119-5b956e21995c // indirect
github.com/gobuffalo/mapi v1.0.1 // indirect
github.com/gobuffalo/meta v0.0.0-20181127070345-0d7e59dd540b // indirect
github.com/gobuffalo/packd v0.0.0-20181212173646-eca3b8fd6687 // indirect
github.com/gobuffalo/syncx v0.0.0-20181120194010-558ac7de985f // indirect
github.com/golang/protobuf v1.4.2 // indirect
github.com/google/go-cmp v0.4.0 // indirect
github.com/imdario/mergo v0.3.9 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/joho/godotenv v1.3.0 // indirect
github.com/karrick/godirwalk v1.7.7 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect
github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2 // indirect
github.com/markbates/safe v1.0.1 // indirect
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mattn/go-runewidth v0.0.7 // indirect
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/nxadm/tail v1.4.4 // indirect
github.com/rogpeppe/go-internal v1.0.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/sirupsen/logrus v1.2.0 // indirect
github.com/xanzy/ssh-agent v0.2.1 // indirect
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb // indirect
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f // indirect
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 // indirect
golang.org/x/text v0.3.3 // indirect
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4 // indirect
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect
google.golang.org/protobuf v1.23.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
Expand Down
Loading

0 comments on commit 0eca3cd

Please sign in to comment.