-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Herokuish builds, deployment rework #146
Conversation
* New concurrency-protected Deployment struct to handle deployment control * Restructured daemon/project package for reduced interface (mostly the Deployment class now) * Streamlined daemon API handler code
Cherrypicked
Note difference between build started and no build
docker-compose check is back baby
Wow this is actually very impressive 😮 |
if givenVersion != version { | ||
version = givenVersion | ||
} | ||
|
||
err := client.InitializeInertiaProject(cmd.Parent().Version) | ||
// Determine best build type for project | ||
buildType := "herokuish" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether it's necessary at this time, but I wonder whether it's a good idea to turn our build types into the go-equivalent of an enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enums in Go seem interesting but I think this would be a good idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was looking at the same article as well 😝
If we go with enums, would we put it in a global constants file; lets say... under common
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, common would be the right place, since the setting is determined clientside 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to leave out the enum for now since it's tricky to handle alongside TOML conversion.
🎟️ Ticket(s): Closes #67
There's no overlap between this PR and the other one
👷 Changes
> Reworked Project Package
Reworked how deployments are managed using a new
Deployment
class, complete with mutex locks and an interface that can be mocked out to test the endpoints, as well as a wide range of minor tweaks and improvements for clarity and maintainability (I think) - this includes usingoption
structs, inspired by the Docker client, to configure commands.Hoping to rework the
client
package in a similar manner (#140)The
Deployment
class holds a whole bunch of parameters and settings pertaining to the state of the deployment.The daemon maintains one global
Deployer
at a time that defines the API the daemon uses to control the project deployment.> Herokuish and Heroku Buildpacks
Daemon startup now downloads two things:
docker-compose
andherokuish
. The latter is from the herokuish project which aims to provide a simulated Heroku build environment, which means any Heroku project should theoretically be able to be turned into a Heroku slug and deployed as a container. Here I try to deploy my Go project:The Herokuish build is a two-step process:
These snippets have been trimmed of err checks, etc for clarity.
> Caveats
web
), which is one of many thatProcfile
supports. I thinkProcfile
also supportsdocker-compose
-style multi-process startups, but I think it might be best to leave that for another PR> Resources
Wow this PR was a pain. Some interesting resources I spent way too much time digging through:
/start
worksdocker run
works (for some reason this took me forever to get write, not as intuitive via the Golang client as it sounds and looks 😢 - perhaps a hint that we need a faster and more iterative testing process for deployment code)Procfile
works and how to set up projects for Heroku🔦 Testing Instructions
In a Heroku-configured project: