Create a gist now

Instantly share code, notes, and snippets.

@heph /nginx-statsd.sh Secret
Last active Aug 29, 2015

Embed
What would you like to do?
Rebuild Nginx deb with nginx-statsd plugin
#!/bin/bash -ex
if [ ! -e "/etc/apt/sources.list.d/nginx.list" ]; then
echo "ERROR! This build slave isn't configured with the nginx apt mirror! (see: http://wiki.nginx.org/Install)"
exit 1
fi
apt-get source nginx
cd $WORKSPACE/nginx-*/debian/
# Increment the package version by updating the changelog
cat > changelog <<CHANGELOG;
nginx (1.6.2-${BUILD_NUMBER}.local) trusty; urgency=medium
* Package built by jenkins
-- jenkins <${USER}@${NODE_NAME}> $(date -R)
CHANGELOG
mkdir modules
cd $WORKSPACE/nginx-*/debian/modules
wget https://github.com/zebrafishlabs/nginx-statsd/archive/master.tar.gz
tar xvf master.tar.gz
rm master.tar.gz
# Enable the nginx-statsd module
sed -i 's|CFLAGS="" ./configure \\|CFLAGS="" ./configure --add-module=debian/modules/nginx-statsd-master \\|' $WORKSPACE/nginx-*/debian/rules
cd $WORKSPACE/nginx-*/
dpkg-buildpackage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment