Skip to content

Instantly share code, notes, and snippets.

@heph
Last active August 29, 2015 14:16
Show Gist options
  • Save heph/9a8c5346250d39634503 to your computer and use it in GitHub Desktop.
Save heph/9a8c5346250d39634503 to your computer and use it in GitHub Desktop.
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