Skip to content

Commit

Permalink
readme: deprecation notice (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
rotemtam authored Oct 15, 2023
1 parent d15abdf commit 65d17c8
Show file tree
Hide file tree
Showing 8 changed files with 178 additions and 74 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
FROM arigaio/atlas:latest-alpine as atlas

FROM golang:1.20 as build
FROM golang:1.21 as build

WORKDIR /go/src/app
COPY . .

RUN go mod download

RUN CGO_ENABLED=0 go build -o /go/bin/app

FROM gcr.io/distroless/static-debian11

ENV PATH="/bin"
RUN go build -o /go/bin/app

COPY --from=atlas /atlas /bin

COPY --from=build /go/bin/app /

CMD ["/app"]
CMD ["/go/bin/app"]
7 changes: 3 additions & 4 deletions .github/workflows/ci-go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.21"
- uses: actions/cache@v3
with:
path: |
Expand All @@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.21"
- uses: actions/cache@v3
with:
path: |
Expand Down Expand Up @@ -65,9 +65,8 @@ jobs:
uses: ./internal/action
with:
url: sqlite://internal/testdata/test.db
cloud-dir: migrations
cloud-dir: deploy-action-test
cloud-token: ${{ secrets.ATLAS_CLOUD_TEST_TOKEN }}
cloud-url: ${{ secrets.ATLAS_CLOUD_TEST_URL }}
- name: Check Error and Compare Current with Target
run: |
error_output="${{ steps.sanity.outputs.error }}"
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# atlas-deploy-action

## Deprecation Notice

This action has been deprecated in favor of the `ariga/atlas-action/migrate/apply` action.

Please see [the docs](https://github.com/ariga/atlas-action#arigaatlas-actionmigrateapply) for more
details.

## About

A GitHub Action to deploy versioned migrations with [Atlas](https://atlasgo.io).

## Supported Workflows
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'atlas-deploy-action'
description: 'Deploy your database schema migrations using Atlas'
description: 'Deprecated. Deploy your database schema migrations using Atlas'
branding:
icon: database
author: 'Ariga'
Expand Down
39 changes: 29 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,26 +1,45 @@
module github.com/ariga/atlas-deploy-action

go 1.20
go 1.21

toolchain go1.21.2

require (
ariga.io/atlas-go-sdk v0.1.0
ariga.io/atlas v0.14.3-0.20231010104048-0c071bfc9161
ariga.io/atlas-go-sdk v0.1.1-0.20231011100517-4211cc50a84f
github.com/mattn/go-sqlite3 v1.14.17
github.com/sethvargo/go-githubactions v1.1.0
github.com/stretchr/testify v1.8.4
)

require (
ariga.io/atlas v0.12.1 // indirect
github.com/agext/levenshtein v1.2.1 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
ariga.io/atlas/cmd/atlas v0.13.2-0.20231010104048-0c071bfc9161 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-openapi/inflect v0.19.0 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/hashicorp/hcl/v2 v2.10.0 // indirect
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/hashicorp/hcl/v2 v2.18.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/pganalyze/pg_query_go/v4 v4.2.3 // indirect
github.com/pingcap/errors v0.11.5-0.20210425183316-da1aaba5fb63 // indirect
github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c // indirect
github.com/pingcap/log v1.1.0 // indirect
github.com/pingcap/tidb/parser v0.0.0-20231010115255-ec2731b8f539 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/sethvargo/go-envconfig v0.9.0 // indirect
github.com/zclconf/go-cty v1.8.0 // indirect
golang.org/x/text v0.8.0 // indirect
github.com/zclconf/go-cty v1.14.1 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
173 changes: 127 additions & 46 deletions go.sum

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ var (

func main() {
act := githubactions.New()
act.Warningf("This action is deprecated. Please use ariga/atlas-action/migrate/apply instead. " +
"For details see: https://github.com/ariga/atlas-action#arigaatlas-actionmigrateapply")
inp, err := Load(act)
if err != nil {
act.Fatalf("failed to load input: %v", err)
Expand Down Expand Up @@ -105,7 +107,7 @@ func Load(act *githubactions.Action) (*Input, error) {
}

// Run runs the "migrate apply" for the input.
func Run(ctx context.Context, i *Input) (*atlasexec.ApplyReport, error) {
func Run(ctx context.Context, i *Input) (*atlasexec.MigrateApply, error) {
wd, err := os.Getwd()
if err != nil {
return nil, err
Expand All @@ -114,7 +116,7 @@ func Run(ctx context.Context, i *Input) (*atlasexec.ApplyReport, error) {
if err != nil {
return nil, err
}
params := &atlasexec.ApplyParams{
params := &atlasexec.MigrateApplyParams{
URL: i.URL,
Amount: i.Amount,
TxMode: i.TxMode,
Expand All @@ -137,5 +139,5 @@ func Run(ctx context.Context, i *Input) (*atlasexec.ApplyReport, error) {
params.ConfigURL = cfg
params.Env = "atlas"
}
return client.Apply(ctx, params)
return client.MigrateApply(ctx, params)
}
2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func fakeCloud(t *testing.T) *httptest.Server {
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
require.Equal(t, "Bearer token", r.Header.Get("Authorization"))
// nolint:errcheck
fmt.Fprintf(w, `{"data":{"dir":{"content":%q}}}`, base64.StdEncoding.EncodeToString(ad))
fmt.Fprintf(w, `{"data":{"dirState":{"content":%q}}}`, base64.StdEncoding.EncodeToString(ad))
}))
return srv
}
Expand Down

0 comments on commit 65d17c8

Please sign in to comment.