A stab at building whatcanidoforfedora.org in stg.
This commit is contained in:
parent
02ec27e931
commit
b9b41189ea
4 changed files with 77 additions and 0 deletions
|
@ -51,6 +51,9 @@
|
||||||
when: master_sundries_node
|
when: master_sundries_node
|
||||||
- role: developer/build
|
- role: developer/build
|
||||||
when: master_sundries_node
|
when: master_sundries_node
|
||||||
|
- role: whatcanidoforfedora/build
|
||||||
|
when: env == "staging"
|
||||||
|
#when: master_sundries_node
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- include: "{{ tasks_path }}/yumrepos.yml"
|
- include: "{{ tasks_path }}/yumrepos.yml"
|
||||||
|
|
2
roles/whatcanidoforfedora/build/files/sync-wcidff.cron
Normal file
2
roles/whatcanidoforfedora/build/files/sync-wcidff.cron
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
MAILTO=web-members@fedoraproject.org
|
||||||
|
15 * * * * apache /usr/local/bin/lock-wrapper sync-wcidff /usr/local/bin/sync-wcidff.sh
|
31
roles/whatcanidoforfedora/build/files/sync-wcidff.sh
Normal file
31
roles/whatcanidoforfedora/build/files/sync-wcidff.sh
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Borrowed heavily from the syncStatic cronjob script.
|
||||||
|
|
||||||
|
if [ ! -d /srv/web/whatcanidoforfedora.org/.git ]
|
||||||
|
then
|
||||||
|
/usr/bin/git clone -q \
|
||||||
|
https://github.com/fedora-infra/asknot-ng.git \
|
||||||
|
/srv/web/whatcanidoforfedora.org
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd /srv/web/whatcanidoforfedora.org
|
||||||
|
|
||||||
|
/usr/bin/git clean -q -fdx || exit 1
|
||||||
|
/usr/bin/git reset -q --hard || exit 1
|
||||||
|
/usr/bin/git checkout -q develop || exit 1
|
||||||
|
/usr/bin/git pull -q --ff-only || exit 1
|
||||||
|
|
||||||
|
err=$(
|
||||||
|
{
|
||||||
|
./build.sh &&\
|
||||||
|
rsync -qa --delete-after --delay-updates build/ "/srv/web/$site/"; \
|
||||||
|
} 2>&1
|
||||||
|
)
|
||||||
|
|
||||||
|
rc=$?
|
||||||
|
if [ $rc -ne 0 ]; then
|
||||||
|
echo "$site build failed"
|
||||||
|
echo "===================================="
|
||||||
|
echo "$err"
|
||||||
|
echo
|
||||||
|
fi
|
41
roles/whatcanidoforfedora/build/tasks/main.yml
Normal file
41
roles/whatcanidoforfedora/build/tasks/main.yml
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
- name: Install needed packages
|
||||||
|
yum: pkg={{ item }} state=present
|
||||||
|
with_items:
|
||||||
|
- PyYAML
|
||||||
|
- git
|
||||||
|
- python-mako
|
||||||
|
tags:
|
||||||
|
- packages
|
||||||
|
- whatcanidoforfedora
|
||||||
|
|
||||||
|
- name: Create directories
|
||||||
|
file: state=directory
|
||||||
|
path=/srv/web/{{item}}
|
||||||
|
owner=apache group=apache mode=0755
|
||||||
|
setype=httpd_sys_content_t seuser=system_u
|
||||||
|
with_items:
|
||||||
|
- whatcanidoforfedora.org
|
||||||
|
tags:
|
||||||
|
- whatcanidoforfedora
|
||||||
|
|
||||||
|
- name: Copy syncStatic script
|
||||||
|
copy:
|
||||||
|
src: sync-wcidff.sh
|
||||||
|
dest: /usr/local/bin/sync-wcidff.sh
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0755
|
||||||
|
tags:
|
||||||
|
- whatcanidoforfedora
|
||||||
|
- cron
|
||||||
|
|
||||||
|
- name: Install the syncStatic and syncTranslations cronjobs
|
||||||
|
copy:
|
||||||
|
src: sync-wcidff.cron
|
||||||
|
dest: /etc/cron.d/sync-wcidff.cron
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0644
|
||||||
|
tags:
|
||||||
|
- whatcanidoforfedora
|
||||||
|
- cron
|
Loading…
Add table
Add a link
Reference in a new issue