Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

WIP: Build master with habitat #453

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4192397
WIP: Add habitat plan
themightychris Jul 28, 2017
ae9d561
WIP: Attempt to get through pip install
themightychris Jul 28, 2017
a9b4dc2
Move git to build deps and use HEAD instead of configured branch
themightychris Jul 28, 2017
d28b5f1
Use all cacert env vars instead of disabling verification
themightychris Jul 28, 2017
0c55ef5
Use newer builds from python2 origin instead of core
themightychris Jul 28, 2017
eca15c3
Move direct package URL to requirements.txt
themightychris Jul 28, 2017
f30e693
Add env for habitat studio
themightychris Jul 28, 2017
81b6b3d
Add habitat results/ to .gitignore
themightychris Jul 28, 2017
ac38374
Add required build headers
themightychris Jul 28, 2017
64cd274
Remove extra attach
themightychris Jul 28, 2017
0284b4c
Bump some pip versions
themightychris Jul 28, 2017
62092f6
Use virtualenv and move pip install to install phase
themightychris Jul 28, 2017
2bed154
Switch back to core/python2
themightychris Jul 28, 2017
feb0797
Order build_deps before deps
themightychris Jul 28, 2017
a0d135b
Deactivate strip phase
themightychris Jul 28, 2017
41afba0
Use upgraded pip and virtualenv
themightychris Jul 28, 2017
2aa2317
Add lxml to requirements.txt
themightychris Jul 28, 2017
ac2fb9b
Copy django tree into $pkg_prefix
themightychris Jul 28, 2017
d83ca8c
Bump celery to 3.1.25
themightychris Jul 28, 2017
e75652d
Bump Django to latest 1.4.x patch release 22
themightychris Jul 28, 2017
2dc0346
Use tzdata package and patch zoneinfo path into Django
themightychris Jul 29, 2017
ca42696
Add geos and psycopg2 to requirements.txt
themightychris Jul 29, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.pyc
*.mo
*.swp
/results/
1 change: 1 addition & 0 deletions .studiorc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export HAB_DEPOT_CHANNEL=unstable
71 changes: 71 additions & 0 deletions habitat/plan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

# much inspiration from https://github.com/habitat-sh/habitat/issues/1514

pkg_name=DistrictBuilder
pkg_origin=codeforphilly
pkg_maintainer="Chris Alfano <[email protected]>"
pkg_description="DistrictBuilder is web-based, open source software for collaborative redistricting."
pkg_upstream_url="https://github.com/PublicMapping/DistrictBuilder"
pkg_license=('Apache-2.0')

# commented out to use local git source instead
#pkg_source="https://github.com/PublicMapping/${pkg_name}/archive/v${pkg_version}.tar.gz"
#pkg_shasum="98127fc80354e7e92aa491643214cac5a29f748cc4a15376a4570e2ce017fcea"

pkg_build_deps=(
core/virtualenv
core/git
core/coreutils
core/gcc
core/zlib
core/libjpeg-turbo
)

pkg_deps=(
core/python2
core/cacerts
core/tzdata
jarvus/postgresql
)

# build version string dynamically from git state
pkg_version() {
echo "${pkg_last_version}+$(git rev-list ${pkg_last_tag}..${pkg_commit} --count)#${pkg_commit}"
}

do_before() {
do_default_before

pkg_commit="$(git rev-parse --short HEAD)"
pkg_last_tag="$(git describe --tags --abbrev=0 ${pkg_commit})"
pkg_last_version=${pkg_last_tag#v}

update_pkg_version
}

do_prepare() {
pip install --upgrade pip virtualenv
virtualenv "$pkg_prefix"
source "$pkg_prefix/bin/activate"
}

do_build() {
return 0
}

do_install() {
# shove alternative root cert location everywhere python things look for it
export SSL_CERT_FILE="$(pkg_path_for cacerts)/ssl/certs/cacert.pem"
export PIP_CERT="$(pkg_path_for cacerts)/ssl/certs/cacert.pem"
export SYSTEM_CERTIFICATE_PATH="$(pkg_path_for cacerts)/ssl/certs"

cp -R django "$pkg_prefix/"
pip install -r requirements.txt

# patch zoneinfo path
sed -i "s#/usr/share/zoneinfo#$(pkg_path_for tzdata)/share/zoneinfo#" "$pkg_prefix/lib/python2.7/site-packages/django/conf/__init__.py"
}

do_strip() {
return 0
}
16 changes: 9 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
Django==1.4.1
celery==3.0.15
Django==1.4.22
celery==3.1.25
django-celery==3.0.11
django-staticfiles==1.2.1
django-tagging==0.3.1
django-sld==1.0.7
inflect==0.2.3
lxml==3.8.0
xhtml2pdf==0.0.4
django-compressor==1.2
python-sld==1.0.9
numpy==1.6.2
scipy==0.11.0
PIL==1.1.7
PySAL==1.5.0
numpy==1.13.1
scipy==0.19.1
http://effbot.org/downloads/Imaging-1.1.7.tar.gz
PySAL==1.13.0
git+git://github.com/PublicMapping/modestmaps-py.git@db-mod_1.4
git+git://github.com/PublicMapping/django-rosetta.git@db-mod_2.0
redis==2.7.6

geos==0.2.1
psycopg2==2.7.3