Some set of fixes that I've done to make g10k usable on a large deployment:
Do not lock modify whole index when deploying a specified branch (main use-case). Achieve this by using git fetch ... instead of doing git remote update --prune each time if we are interested only in one branch. Races are very common when trying to update all of the refs. Errors can still happen however because the webhook uses one goroutine it is very unlikely (imagine an event listener that fires off g10k deployments). Also, if one or more deploys when there >1 concurrent deploys at the same time will fail then it's not the end of the world because the one which "caught" the newest ref will succeed. Still do an initial git remote update --prune to download all of the refs and branches.
Implement the timeout functionality. Make proper contexts and pass them to CommandContext()
Add a proper debug output with the command name + output + the error
Verification:
The tests pass
Battle-tested on a huge deployment (:
Pardon me if my coding style is bad or I did some mistakes.
Some set of fixes that I've done to make g10k usable on a large deployment:
git fetch ...
instead of doinggit remote update --prune
each time if we are interested only in one branch. Races are very common when trying to update all of the refs. Errors can still happen however because the webhook uses one goroutine it is very unlikely (imagine an event listener that fires off g10k deployments). Also, if one or more deploys when there >1 concurrent deploys at the same time will fail then it's not the end of the world because the one which "caught" the newest ref will succeed. Still do an initialgit remote update --prune
to download all of the refs and branches.CommandContext()
Verification:
Pardon me if my coding style is bad or I did some mistakes.