I miss the days of
git push heroku. How hard would it be to do this
I did find an old project called git-deploy which integrates very
nicely with the git command, but has a bunch of
specific stuff inside of the build script itself. I love ruby, but
I'm in more of a
docker based life-style right now. So i took the
opportinity to time travel back into blogs from the early '10s to pick
apart this information for you!
The Basic Plan
First we are going to setup git on the server. We'll create an
user that will do the deployment and host the repositories.
Connect to the server and create the user with the
docker group so it
can do builds. We'll copy of the
.ssh keys so that we can log in
without a password.
Finally, lets create a place for the apps to live.
Create an empty repo and push to it
On the server:
Then make sure it's executable
And also make sure that you've logged into your registry!
Test it out
Back on your laptop:
Lets pull down a repo, give it a
Dockerfile, and push it to our server
to see if it builds.
Lets create a
Dockerfile that we'll use to build this up:
And you should see it build and push to the repository in your git client!
On the server you can test this with:
So it works, it builds and is in the registry. This isn't a generalized solution but its a good start.
Look at all this going back in time!
- Missing git hooks documentation
- Dokku Git Deployment
- Digital Ocean: How To Use Git Hooks To Automate Development and Deployment Tasks
- awesome git hooks
- Omer Katz: Git Hooks (Part I) - The Basics