Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F102998
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, 11:27 AM
2015-03-23 11:27:21 (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"
)
debianize_options
=
"-I django-templatetag-sugar -I statsd -I Django"
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); puts j[\"releases\"][\"
$version
\"][0][\"url\"]"
)
versionedpackage
=
"
$package
-
$version
"
wget
$uri
tar xzvf
"
$versionedpackage
.tar.gz"
cd
$versionedpackage
../debianize.sh/debianize.sh -m
"
$author
"
$debianize_options
mv *.deb ..
cd
..
rm -rf
$versionedpackage
rm
"
$versionedpackage
.tar.gz"
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
99940
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