Home > Back-end >  How to simple CI/CD with git bare repo
How to simple CI/CD with git bare repo

Time:09-27

In Office, we use git bare repo to be our remote repo on NAS, we don't use gitlab or github etc.

And we have another own remote server to host products(without git). I need to FTP to remote server and deploy manually everytime.

At least, I want to FTP to remote server automaticlly after I push to remote bare repo specific branch or after switch to another commit in remote bare repo,

At first, I intend to use git hooks(after recive or post checkout) to FTP to remote server, but I don't know how to do it in "remote bare repo to another remote server", Or does any other tools I can use with bare repo?

CodePudding user response:

I don't know how to do it in "remote bare repo to another remote server"

As long as that remote bare repo can access (network) the other remote server, its post-receive hook can be configured to execute any command you need.
Including an sftp or an scp, in order to copy an archive of the bare repository content (through git archive, even for just the changed files)

No need for CICD then: a simple push to the remote bare repository would trigger the hook.

  • Related