forked from okfn/ckanbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
datagov-buildserver.yml
113 lines (93 loc) · 4.08 KB
/
datagov-buildserver.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
---
- hosts: build
vars_prompt:
- name: version
prompt: "Ckan Version"
private: False
- name: iteration
prompt: "Iteration"
private: False
tasks:
- name: install epel
action: command creates=/etc/yum.repos.d/epel.repo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
- name: make sure packages are installed
action: yum pkg=$item state=installed
with_items:
- htop
- rubygems
- python-virtualenv
- python-setuptools
- git
- python-devel
- ruby-devel
- postgresql-libs
- postgresql-devel
- libxml2-devel
- libxslt-devel
- postgresql
- rpmdevtools
- gcc
- gcc-c++
- make
- bison
- httpd
- createrepo
- mod_wsgi
- supervisor
- nginx
- name: install fpm
action: command gem install fpm creates=/usr/bin/fpm
- name: get ckan version
action: git repo=https://github.com/okfn/ckan dest=/usr/lib/ckan/src/ckan # version=release-0.22
- name: get pip
action: easy_install name=pip
- name: install requirements and make virtualenv
action: pip requirements=/usr/lib/ckan/src/ckan/pip-requirements.txt virtualenv=/usr/lib/ckan/
- name: run setup.py develop for ckan
action: command chdir=/usr/lib/ckan/src/ckan/ ../../bin/python setup.py develop
- name: get geodatagov
action: git repo=https://github.com/okfn/ckanext-geodatagov dest=/usr/lib/ckan/src/ckanext-geodatagov # version=release-0.22
- name: install requirements for geodatagov
action: pip requirements=/usr/lib/ckan/src/ckanext-geodatagov/pip-requirements.txt virtualenv=/usr/lib/ckan/
- name: run setup.py develop for geodatagov
action: command chdir=/usr/lib/ckan/src/ckan/ ../../bin/python setup.py develop
- name: install requirements for spacial
action: pip requirements=/usr/lib/ckan/src/ckanext-spatial/pip-requirements.txt virtualenv=/usr/lib/ckan/
- name: install requirements for harvest
action: pip requirements=/usr/lib/ckan/src/ckanext-harvest/pip-requirements.txt virtualenv=/usr/lib/ckan/
- name: remove old repo
action: file path=/var/www/ckan-repo state=absent
- name: create directories
action: file path=$item state=directory
with_items:
- /etc/ckan
- /var/www/ckan-repo
- name: copy all needed files
action: copy src=$item dest=/$item
with_items:
- etc/ckan/who.ini
- etc/ckan/apache.wsgi
- etc/cron.daily/remove_old_sessions
- etc/nginx/conf.d/ckan.conf
- name: copy production.ini
action: copy src=datagov_config/production.ini dest=/etc/ckan/production.ini
- name: copy ckan.ini
action: copy src=datagov_config/ckan.ini dest=/etc/ckan/ckan.ini
- name: copy supervisor conf
action: copy src=datagov_config/supervisord.conf dest=/etc/ckan/supervisord.conf
- name: default apache removed
action: file path=/etc/httpd/conf.d/welcome.conf state=absent
- name: add ckan apache
action: copy src=datagov_config/ckan.conf dest=/etc/httpd/conf.d/ckan.conf
- name: copy ckan command
action: copy src=ckanroot dest=/usr/bin/ckan
- name: add ckan- repo apache config
action: copy src=datagov_config/ckan-repo.conf dest=/etc/httpd/conf.d/ckan-repo.conf
- name: restart apache
action: service name=httpd state=restarted
- name: copy after web script
action: copy src=datagov_config/after_web.sh dest=/tmp/after_web.sh
- name: build rpm
action: command chdir=/var/www/ckan-repo/ fpm -t rpm -s dir --after-install=/tmp/after_web.sh -n geo.data.gov --iteration $iteration -v $version -d nginx -d httpd -d supervisor -d rabbitmq-server -d mod_wsgi --config-files /etc/ckan/ckan.ini --config-files /etc/httpd/conf.d/ckan.conf /usr/bin/ckan /usr/lib/ckan/ /etc/ckan/ /etc/cron.daily/remove_old_sessions /etc/httpd/conf.d/ckan.conf /etc/nginx/conf.d/ckan.conf
- name: create repo
action: command createrepo /var/www/ckan-repo/