mirror of
https://github.com/ivabus/pantry
synced 2024-11-23 00:45:07 +03:00
45 lines
1,007 B
YAML
45 lines
1,007 B
YAML
|
distributable:
|
||
|
url: https://github.com/pressly/goose/archive/refs/tags/{{version.tag}}.tar.gz
|
||
|
strip-components: 1
|
||
|
|
||
|
versions:
|
||
|
github: pressly/goose
|
||
|
|
||
|
provides:
|
||
|
- bin/goose
|
||
|
|
||
|
build:
|
||
|
dependencies:
|
||
|
go.dev: ^1.20
|
||
|
working-directory: cmd/goose
|
||
|
script:
|
||
|
- go mod download
|
||
|
- go build -v -trimpath -ldflags="$GO_LDFLAGS" -o '{{prefix}}/bin/goose' .
|
||
|
env:
|
||
|
GO_LDFLAGS:
|
||
|
- -s
|
||
|
- -w
|
||
|
- -X main.version=v{{version}}
|
||
|
linux:
|
||
|
# or segmentation fault
|
||
|
# fix found here https://github.com/docker-library/golang/issues/402#issuecomment-982204575
|
||
|
GO_LDFLAGS:
|
||
|
- -buildmode=pie
|
||
|
|
||
|
test:
|
||
|
dependencies:
|
||
|
sqlite.org: 3
|
||
|
env:
|
||
|
GOOSE_DRIVER: sqlite3
|
||
|
GOOSE_DBSTRING: ./test.db
|
||
|
GOOSE_MIGRATION_DIR: ./migrations
|
||
|
script:
|
||
|
- 'test "$(goose -version)" = "goose version: v{{version}}"'
|
||
|
- mkdir -p $GOOSE_MIGRATION_DIR
|
||
|
- goose create add_some_column sql
|
||
|
- goose status
|
||
|
- goose up
|
||
|
- goose status
|
||
|
- goose down
|
||
|
- goose status
|