From 42361994b26daf7b91738a0ab992cd4a54eef976 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Tue, 16 Dec 2014 18:50:56 +0100 Subject: Add a role to deploy the website directly from git --- roles/deploy_website/defaults/main.yml | 5 +++++ roles/deploy_website/tasks/main.yml | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 roles/deploy_website/defaults/main.yml create mode 100644 roles/deploy_website/tasks/main.yml diff --git a/roles/deploy_website/defaults/main.yml b/roles/deploy_website/defaults/main.yml new file mode 100644 index 0000000..e9199b2 --- /dev/null +++ b/roles/deploy_website/defaults/main.yml @@ -0,0 +1,5 @@ +--- +checkout_dest: /srv/website_checkout +git_repo: https://git.fedorahosted.org/git/tosw.git +destination: /var/www/ +subdir: website diff --git a/roles/deploy_website/tasks/main.yml b/roles/deploy_website/tasks/main.yml new file mode 100644 index 0000000..3111048 --- /dev/null +++ b/roles/deploy_website/tasks/main.yml @@ -0,0 +1,10 @@ +--- +- yum: name={{ item }} state=installed + with_items: + - git + +- file: dest={{ checkout_dest }} state=directory + +- git: repo={{ git_repo }} dest={{ checkout_dest }} + +- cron: name="{{ git_repo }} autoupdate" hour=* job="cd {{ checkout_dest }} ; git pull --rebase -q ; cp -f -R {{ subdir }} {{ destination }}" -- cgit