Skip to content

Commit

Permalink
Merge pull request #1465 from flipt-io/gm/release-tooling
Browse files Browse the repository at this point in the history
feat(hack/build): release tooling
  • Loading branch information
GeorgeMac authored Apr 6, 2023
2 parents 1eb2750 + eb0c3be commit 53d26e2
Show file tree
Hide file tree
Showing 12 changed files with 593 additions and 152 deletions.
48 changes: 0 additions & 48 deletions .github/workflows/release-submodules.yml

This file was deleted.

4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ jobs:
env:
TAG: ${{ github.ref_name }}
run: |
if [[ $TAG == $(cat version.txt) ]]; then
cd hack/build
if [[ $TAG == $(mage release:latest go.flipt.io/flipt) ]]; then
docker pull flipt/flipt:$TAG
skopeo copy --all docker://flipt/flipt:$TAG docker://flipt/flipt:latest
Expand Down
21 changes: 14 additions & 7 deletions cmd/flipt/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,27 @@ func (c *importCommand) run(cmd *cobra.Command, args []string) error {

logger, cfg := buildConfig()

migrator, err := sql.NewMigrator(*cfg, logger)
if err != nil {
return err
}

defer migrator.Close()

// drop tables if specified
if c.dropBeforeImport {
logger.Debug("dropping tables")

migrator, err := sql.NewMigrator(*cfg, logger)
if err != nil {
return err
}

if err := migrator.Drop(); err != nil {
return fmt.Errorf("attempting to drop: %w", err)
}

if _, err := migrator.Close(); err != nil {
return fmt.Errorf("closing migrator: %w", err)
}
}

migrator, err := sql.NewMigrator(*cfg, logger)
if err != nil {
return err
}

if err := migrator.Up(forceMigrate); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ require (
github.com/uber/jaeger-client-go v2.30.0+incompatible
github.com/xo/dburl v0.13.1
go.flipt.io/flipt/errors v1.19.3
go.flipt.io/flipt/rpc/flipt v1.19.3
go.flipt.io/flipt/rpc/flipt v1.20.0-rc1
go.flipt.io/flipt/sdk/go v0.1.1
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.40.0
go.opentelemetry.io/otel v1.14.0
Expand Down
20 changes: 13 additions & 7 deletions hack/build/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ go 1.20

require (
dagger.io/dagger v0.5.2
github.com/bradleyfalzon/ghinstallation/v2 v2.2.0
github.com/containerd/containerd v1.6.18
github.com/docker/docker v23.0.1+incompatible
github.com/go-git/go-git/v5 v5.6.1
github.com/gofrs/uuid v4.4.0+incompatible
github.com/google/go-github/v50 v50.2.0
github.com/google/uuid v1.3.0
github.com/magefile/mage v1.14.0
github.com/opencontainers/image-spec v1.1.0-rc2
Expand All @@ -27,45 +26,52 @@ require (
github.com/Khan/genqlient v0.5.0 // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/adrg/xdg v0.4.0 // indirect
github.com/alessio/shellescape v1.4.1 // indirect
github.com/cloudflare/circl v1.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 // indirect
github.com/iancoleman/strcase v0.2.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/skeema/knownhosts v1.1.0 // indirect
github.com/spf13/cobra v1.6.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/vektah/gqlparser/v2 v2.5.1 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/oauth2 v0.6.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/time v0.1.0 // indirect
golang.org/x/tools v0.7.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230320184635-7606e756e683 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.1.0 // indirect
Expand Down
Loading

0 comments on commit 53d26e2

Please sign in to comment.