diff --git a/projects/pressly.github.io/goose/package.yml b/projects/pressly.github.io/goose/package.yml new file mode 100644 index 00000000..99e6c970 --- /dev/null +++ b/projects/pressly.github.io/goose/package.yml @@ -0,0 +1,44 @@ +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