From cb8aa175462b567d990dac1e1b1868cfe0717eca Mon Sep 17 00:00:00 2001 From: Greg Allen Date: Fri, 16 May 2014 09:14:09 -0700 Subject: [PATCH 1/3] initial work on caching nginx deb --- bin/compile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/compile b/bin/compile index e7078dd..8546b10 100755 --- a/bin/compile +++ b/bin/compile @@ -1,8 +1,15 @@ #!/usr/bin/env bash set -e -apt-get update -apt-get -y install nginx +CACHEDIR=$2 +NGINXFILE=nginx_1.2.1-2.2ubuntu0.2_all.deb + +if [[ ! -f "$CACHEDIR/$NGINXFILE" ]]; then + apt-get download nginx + mv $NGINXFILE $CACHEDIR +fi + +dpkg -i $CACHEDIR/$NGINXFILE BINDIR=$(dirname "$0") From f77f946550e7484a6cf05cfa48fff4b274d0aadf Mon Sep 17 00:00:00 2001 From: Greg Allen Date: Fri, 16 May 2014 10:07:38 -0700 Subject: [PATCH 2/3] run update before attempting to download --- bin/compile | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/compile b/bin/compile index 8546b10..71afc32 100755 --- a/bin/compile +++ b/bin/compile @@ -5,6 +5,7 @@ CACHEDIR=$2 NGINXFILE=nginx_1.2.1-2.2ubuntu0.2_all.deb if [[ ! -f "$CACHEDIR/$NGINXFILE" ]]; then + apt-get update apt-get download nginx mv $NGINXFILE $CACHEDIR fi From ca72e926e3a4d2b1f9c4ff1877ab06f8cb63d02a Mon Sep 17 00:00:00 2001 From: Greg Allen Date: Fri, 16 May 2014 10:13:10 -0700 Subject: [PATCH 3/3] added nginx-common and nginx-full --- bin/compile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/bin/compile b/bin/compile index 71afc32..f216a6f 100755 --- a/bin/compile +++ b/bin/compile @@ -2,15 +2,19 @@ set -e CACHEDIR=$2 -NGINXFILE=nginx_1.2.1-2.2ubuntu0.2_all.deb +NGINX_COMMON=nginx-common_1.2.1-2.2ubuntu0.2_all.deb +NGINX_FULL=nginx-full_1.2.1-2.2ubuntu0.2_amd64.deb +NGINX=nginx_1.2.1-2.2ubuntu0.2_all.deb -if [[ ! -f "$CACHEDIR/$NGINXFILE" ]]; then +if [[ ! -f "$CACHEDIR/$NGINX" ]]; then apt-get update - apt-get download nginx - mv $NGINXFILE $CACHEDIR + apt-get download nginx nginx-common nginx-full + mv nginx* $CACHEDIR/ fi -dpkg -i $CACHEDIR/$NGINXFILE +dpkg -i $CACHEDIR/$NGINX_COMMON +dpkg -i $CACHEDIR/$NGINX_FULL +dpkg -i $CACHEDIR/$NGINX BINDIR=$(dirname "$0")