Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coffebar/ansible-git-hook-example
setup continuous delivery via git post-receive hook
https://github.com/coffebar/ansible-git-hook-example
Last synced: about 1 month ago
JSON representation
setup continuous delivery via git post-receive hook
- Host: GitHub
- URL: https://github.com/coffebar/ansible-git-hook-example
- Owner: coffebar
- Created: 2023-03-09T13:05:39.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-06-13T08:16:12.000Z (5 months ago)
- Last Synced: 2024-06-13T11:12:43.521Z (5 months ago)
- Language: Jinja
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Deployment to server by git push
This is example how to configure simple deployment with git:
#### When you commit and push some changes to live, it will be on server.
Nodejs, npm and axios will be installed
for example.### How to set up this example on server
- You need to have ansible installed on local machine.
- Edit servers list (inventory file) with root users:
`ansible/hosts`
- Clone repo and run `./ansible/first-deploy.sh`
- When it succeeds, add remote repo to git, for example:
```bash
git remote add live ssh://git@us2/home/git/project.git
```
If your ssh configuration is correct, you can commit some changes and push it:```bash
git push live master
```### SSH configuration
By default, git user will be authorized to log-in
by ssh with you key located at ~/.ssh/id_rsaYou may change this in ansible/tasks/ssh.yml
You also can make some adjustments like this:
```bash
git config --add --local core.sshCommand 'ssh -i ~/.ssh/id_rsa'
```Or configure it globally in ~/.ssh/config