Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F103015
Bash_script_to_automatically_package_python_extensions_needed_by_Sentry
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
Gilles
Mar 23 2015, 12:51 PM
2015-03-23 12:51:01 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
Bash_script_to_automatically_package_python_extensions_needed_by_Sentry
View Options
#!/bin/bash
author
=
"Gilles Dubuc <gilles@wikimedia.org>"
packages
=(
"django-crispy-forms"
"django-paging"
"django-recaptcha"
"django-statsd-mozilla"
"django-sudo"
"django-templatetag-sugar"
"email_reply_parser"
"gunicorn"
"logan"
"nydus"
"raven"
"toronado"
"python-memcached"
)
debianize_options
=
"-I django-templatetag-sugar -I statsd -I Django -I cssselect -I cssutils -I lxml -I six"
if
!
[
-x
"
$(
command
-v fpm
)
"
]
;
then
apt-get update
apt-get install ruby ruby-dev rubygems
gem update
gem install fpm
fi
if
!
[
-x
"
$(
command
-v git
)
"
]
;
then
apt-get update
apt-get install git
fi
if
!
[
-x
"
$(
command
-v pip
)
"
]
;
then
apt-get update
apt-get install python python-setuptools
easy_install pip
fi
timestamp
=
$(
date
"+%s"
)
workingdir
=
"/tmp/sentrypackages-
$timestamp
"
mkdir
$workingdir
cd
$workingdir
git clone git://github.com/specialunderwear/debianize.sh.git
for
package in
"
${
packages
[@]
}
"
do
jsonuri
=
"https://pypi.python.org/pypi/
$package
/json"
version
=
$(
wget -q -O -
$jsonuri
|
ruby -rjson -e
'j = JSON.parse(ARGF.read); puts j["info"]["version"]'
)
uri
=
$(
wget -q -O -
$jsonuri
|
ruby -rjson -e
'j = JSON.parse(ARGF.read); j["urls"].each { |x| if x["packagetype"] == "sdist" then puts x["url"] end }'
)
versionedpackage
=
"
$package
-
$version
"
wget
$uri
if
[
-e
"
$versionedpackage
.zip"
]
;
then
package
=
"
$versionedpackage
.zip"
unzip
$package
else
package
=
"
$versionedpackage
.tar.gz"
tar xzvf
$package
fi
cd
$versionedpackage
../debianize.sh/debianize.sh -m
"
$author
"
$debianize_options
mv *.deb ..
cd
..
rm -rf
$versionedpackage
rm
"
$package
"
done
rm -rf debianize.sh
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
99956
Default Alt Text
Bash_script_to_automatically_package_python_extensions_needed_by_Sentry (1 KB)
Attached To
Mode
P421 Bash script to automatically package python extensions needed by Sentry
Attached
Detach File
Event Timeline
Log In to Comment