Heroku buildpack that makes a service/project in a mono repo the root directory for deployment.
.monofile in the root folder of the repo.
HMR_APP_DIRin Heroku and set it to the path of the service to be deployed relative to the root folder of the repo.
HMR_LOCAL_MODULESin Heroku and provide with a space delimetered value of local do modules to be included in the deployment context.
Given you have the folder directory structure:
repo |_ auth |_ db |_ go.mod |_ go.sum |_ pmt |_ usrv |_ .mono
If you want to deploy the contents of the pmt folder, you would execute the following:
heroku config:set HMR_APP_DIR=pmt heroku config:set HMR_LOCAL_MODULES=auth db heroku buildpacks:add https://github.com/ekowcharles/heroku-mono-repo.git --index 1
We put this buildpack at index 1 because it is expected to be executed before any subsequest buildpacks are executed. Check this out to learn more about multiple buildpacks.
You can always clear your buildpacks using the following command:
Copyright (c) 2019 C A Boadu Jnr
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copy the snippet above into CLI.