By alenn
How to install additional packages which are not part of the go.mod, for example the goose package: https://github.com/pressly/goose
I’m using 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 Console.
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!
Hi there,
I would suggest including the module in your go.mod file 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.
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.