How to install additional packages which are not part of the
go.mod, for example the
goose package: https://github.com/pressly/goose
goose package for managing migrations, and I can’t find a way to install it on App Platform.
I tried adding
go install https://github.com/pressly/goose/v3/cmd/goose@latest to
Build Command section, and the package is installed, but I can’t access it through
Then I tried:
go install https://github.com/pressly/goose/v3/cmd/goose@latest && goose up (this is inside Build Command) which should execute the migrations, but in the build logs I get error that
goose is not found.
I hope someone will have answers for my problems :)
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $200 of credit to try our products over 60 days!
I would suggest including the module in your
go.modfile so that it will be auto-detected and installed during the build process. Do you have any specific concerns about including the module there?
Regarding the migration step itself, usually, it is best to run your migrations during the deployment/run process rather than the build process itself. That way if the deploy porcess fails but the build process completes and your migrations are executed, then you will end up in a sutiation where your running code might not be compatible with the new schema changes.