Skip to content

Commit

Permalink
Update skeletor to work with v1.0.0-alpha.22 (#32)
Browse files Browse the repository at this point in the history
* Update skeletor to work with v1.0.0-alpha.22

* Use v1.0.0-alpha.22 of Porter
* Switch from using the old magefile helper in Porter to using the new
  magefiles repository
* Add the TestPublish magefile target
* Rename get.porter.sh/porter/pkg/context to portercontext
* Change the skeletor go mod name so that it's easier for people to
  find/replace their way to a custom mixin. Using our vanity domain
  wasn't really helping anyone.
* Fix bad reference to packr, skeletor uses go:embed now.

Signed-off-by: Carolyn Van Slyck <[email protected]>

* Add ConfigureAgent target

Signed-off-by: Carolyn Van Slyck <[email protected]>
  • Loading branch information
carolynvs authored Jul 8, 2022
1 parent 6261f95 commit ab7a7a0
Show file tree
Hide file tree
Showing 17 changed files with 544 additions and 222 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
bin
.cnab
*-packr.go
build/git_askpass.sh

6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ structure of this project matches closely with existing Porter [Mixins](https://
1. Go 1.17 or higher is required. You can choose to clone into the GOPATH or not according to preference.
1. Rename the `cmd/skeletor` and `pkg/skeletor` directories to `cmd/YOURMIXIN` and
`pkg/YOURMIXIN`.
1. Find the text `get.porter.sh/mixin/skeletor` in the repository and change it to
`github.com/YOURNAME/YOURREPO`.
1. Find any remaining `skeletor` text in the repository and replace it with `YOURMIXIN`.
1. In `pkg/YOURMIXIN/version.go` replace `YOURNAME` with the name you would like displayed as the mixin
author. This value is displayed as the author of your mixin when `porter mixins list` is run.
Expand Down Expand Up @@ -77,11 +75,11 @@ This skeleton mixin project brings some free capabilities:

### File System Access and Context

Porter provides a [Context](https://porter.sh/src/pkg/context) package that has helpful mechanisms for accessing the File System using [spf13/afero](https://github.com/spf13/afero). This makes it easy to provide mock File System implementations during testing. The Context package also provides a mechanism to encapsualte stdin, stdout and stderr so that they can easily be passed from `cmd/skeletor` code to implementing `pkg/skeletor` code.
Porter provides the [portercontext](https://porter.sh/src/pkg/portercontext) package that has helpful mechanisms for accessing the File System using [spf13/afero](https://github.com/spf13/afero). This makes it easy to provide mock File System implementations during testing. The portercontext package also provides a mechanism to encapsulate stdin, stdout and stderr so that they can easily be passed from `cmd/skeletor` code to implementing `pkg/skeletor` code.

### Template and Static Asset Handling

The project already includes [Packr V2](https://github.com/gobuffalo/packr/tree/master/v2) for dealing with static files, such as templates or other content that is best modeled outside of a Go file. You can see an example of this in `pkg/skeletor/schema.go`.
The project go:embed for dealing with static files, such as templates or other content that is best modeled outside of a Go file. You can see an example of this in `pkg/skeletor/schema.go`.

### Basic Schema

Expand Down
2 changes: 1 addition & 1 deletion cmd/skeletor/build.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"get.porter.sh/mixin/skeletor/pkg/skeletor"
"github.com/getporter/skeletor/pkg/skeletor"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/skeletor/install.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"get.porter.sh/mixin/skeletor/pkg/skeletor"
"github.com/getporter/skeletor/pkg/skeletor"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/skeletor/invoke.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"get.porter.sh/mixin/skeletor/pkg/skeletor"
"github.com/getporter/skeletor/pkg/skeletor"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/skeletor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"
"os"

"get.porter.sh/mixin/skeletor/pkg/skeletor"
"github.com/getporter/skeletor/pkg/skeletor"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/skeletor/schema.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"get.porter.sh/mixin/skeletor/pkg/skeletor"
"github.com/getporter/skeletor/pkg/skeletor"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/skeletor/uninstall.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"get.porter.sh/mixin/skeletor/pkg/skeletor"
"github.com/getporter/skeletor/pkg/skeletor"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/skeletor/upgrade.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"get.porter.sh/mixin/skeletor/pkg/skeletor"
"github.com/getporter/skeletor/pkg/skeletor"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/skeletor/version.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package main

import (
"get.porter.sh/mixin/skeletor/pkg/skeletor"
"get.porter.sh/porter/pkg/porter/version"
"github.com/getporter/skeletor/pkg/skeletor"
"github.com/spf13/cobra"
)

Expand Down
85 changes: 40 additions & 45 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module get.porter.sh/mixin/skeletor
module github.com/getporter/skeletor

go 1.17

Expand All @@ -12,16 +12,16 @@ replace (
)

require (
get.porter.sh/porter v1.0.0-alpha.7
get.porter.sh/magefiles v0.3.1
get.porter.sh/porter v1.0.0-alpha.22
github.com/ghodss/yaml v1.0.0
github.com/spf13/cobra v1.1.3
github.com/stretchr/testify v1.7.0
github.com/spf13/cobra v1.2.1
github.com/stretchr/testify v1.7.1
github.com/xeipuuv/gojsonschema v1.2.0
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/PaesslerAG/gval v1.0.0 // indirect
Expand All @@ -30,89 +30,84 @@ require (
github.com/andybalholm/brotli v1.0.0 // indirect
github.com/andybalholm/cascadia v1.0.0 // indirect
github.com/carolynvs/aferox v0.3.0 // indirect
github.com/carolynvs/magex v0.6.0 // indirect
github.com/carolynvs/magex v0.8.0 // indirect
github.com/cbroglie/mustache v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.1.1 // indirect
github.com/cnabio/cnab-go v0.21.0 // indirect
github.com/cenkalti/backoff/v4 v4.1.2 // indirect
github.com/cnabio/cnab-go v0.23.3 // indirect
github.com/cyberphone/json-canonicalization v0.0.0-20210303052042-6bc126869bf4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dsnet/compress v0.0.1 // indirect
github.com/fatih/color v1.9.0 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 // indirect
github.com/gobuffalo/logger v1.0.4 // indirect
github.com/gobuffalo/packd v1.0.0 // indirect
github.com/gobuffalo/packr/v2 v2.8.1 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/goccy/go-yaml v1.8.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4-0.20210608040537-544b4180ac70 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-hclog v0.14.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jeremywohl/flatten v1.0.1 // indirect
github.com/karrick/godirwalk v1.16.1 // indirect
github.com/klauspost/compress v1.12.3 // indirect
github.com/klauspost/compress v1.15.1 // indirect
github.com/klauspost/pgzip v1.2.4 // indirect
github.com/kr/pretty v0.2.1 // indirect
github.com/magefile/mage v1.11.0 // indirect
github.com/magiconair/properties v1.8.1 // indirect
github.com/markbates/errx v1.1.0 // indirect
github.com/markbates/oncer v1.0.0 // indirect
github.com/markbates/safe v1.0.1 // indirect
github.com/mattn/go-colorable v0.1.7 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/mattn/go-runewidth v0.0.7 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/mholt/archiver/v3 v3.5.0 // indirect
github.com/mikefarah/yq/v3 v3.0.0-20201020025845-ccb718cd0f59 // indirect
github.com/mitchellh/mapstructure v1.3.3 // indirect
github.com/mitchellh/mapstructure v1.4.2 // indirect
github.com/mmcdole/gofeed v1.0.0-beta2 // indirect
github.com/mmcdole/goxpp v0.0.0-20181012175147-0068e33feabf // indirect
github.com/nwaples/rardecode v1.1.0 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/olekukonko/tablewriter v0.0.4 // indirect
github.com/pelletier/go-toml v1.9.1 // indirect
github.com/osteele/liquid v1.3.0 // indirect
github.com/osteele/tuesday v1.0.3 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pierrec/lz4/v4 v4.0.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/qri-io/jsonpointer v0.1.1 // indirect
github.com/qri-io/jsonschema v0.2.2-0.20210723092138-2eb22ee8115f // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/qri-io/jsonschema v0.2.2-0.20210831022256-780655b2ba0e // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/smartystreets/assertions v1.0.0 // indirect
github.com/spf13/afero v1.5.1 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.7.0 // indirect
github.com/spf13/viper v1.8.1 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/ulikunitz/xz v0.5.7 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
go.opentelemetry.io/otel v1.1.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.1.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.1.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.1.0 // indirect
go.opentelemetry.io/otel/sdk v1.1.0 // indirect
go.opentelemetry.io/otel/trace v1.1.0 // indirect
go.opentelemetry.io/proto/otlp v0.9.0 // indirect
go.uber.org/atomic v1.5.0 // indirect
go.uber.org/multierr v1.3.0 // indirect
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee // indirect
go.uber.org/zap v1.13.0 // indirect
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/mod v0.3.0 // indirect
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect
go.opentelemetry.io/otel v1.7.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.4.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.4.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.4.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.4.1 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.7.0 // indirect
go.opentelemetry.io/otel/sdk v1.7.0 // indirect
go.opentelemetry.io/otel/trace v1.7.0 // indirect
go.opentelemetry.io/proto/otlp v0.12.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.17.0 // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
golang.org/x/text v0.3.5 // indirect
golang.org/x/tools v0.0.0-20210106214847-113979e3529a // indirect
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a // indirect
google.golang.org/grpc v1.41.0 // indirect
google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106 // indirect
google.golang.org/grpc v1.45.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/ini.v1 v1.56.0 // indirect
gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
honnef.co/go/tools v0.0.1-2020.1.5 // indirect
)
Loading

0 comments on commit ab7a7a0

Please sign in to comment.