Something Simple About GIT You Don't Use
Want to deploy your code without all the complicated tools? You can do it with just Git and SSH! There are lots of guides online for using CI/CD pipelines, Docker, and Kubernetes, but sometimes the simplest solution is the best.
Setting up remote repo
You can use a standard ssh server to setup remote git repository:
ssh user@192.168.1.1 git init app
Isn’t this simple?
Adding a remote to you local repository
git remote add deploy ssh://user@192.168.1.1
Now you can push the git branch to the remore repository:
# on branch 'develop'
git push deploy develop
Deploying the code
In order to deploy the code, merge the branches on the remote:
ssh user@192.168.1.1 'cd app && git merge develop'
Now the code on remote machine is up to date. Updating the app instances can be done using the same approach.
Is this approach scalable?
Yes, it’s possible to make everything scalable. In this case with a simple deploy script or Ansible.