SpecialistOff.NET / Вопросы / Статьи / Фрагменты кода / Резюме / Метки / Помощь / Файлы
Список вопросов ПечатьМетки: git ansible ci/cd continuous integration continuous delivery continuous deployment devops devops ansible-playbook
RemiZOffAlex Создано: 2018-10-29 21:48:04.224504 Обновлено: 2018-10-29 21:48:04.224504 |
---|
Простой CI для git проекта можно реализовать через вызов скрипта после очередного коммита. В том числе запустить ansible-playbook Файл .git/hooks/post-commit #!/bin/sh if [[ -f .post-commit.sh ]] then . .post-commit.sh fi if [[ ! -d .ansible ]] then echo 'No .ansible directory' echo 'mkdir .ansible' exit 1 fi if [[ -f .ansible/post-commit.yml ]] then ANSIBLE_CONFIG=.ansible/ansible.cfg ansible-playbook .ansible/post-commit.yml fi Устанавливаем права на выполнение chmod +x .git/hooks/post-commit |