diff --git a/.gitignore b/.gitignore index bc3fea5..74f4ca2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .env lambda-deploy.zip lambda-layer-deploy.zip -.DS_Store \ No newline at end of file +.DS_Store +lambda/* +python/lambda/* \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 61497da..df09bfb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -212,6 +212,10 @@ RUN \ ./config shared --prefix=${PREFIX}/openssl --openssldir=${PREFIX}/openssl; \ make depend; make install; cd ..; rm -rf openssl +# rsync is required by bin/package.sh, so install it here +RUN \ + yum install -y rsync + # Copy shell scripts and config files over COPY bin/* /usr/local/bin/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3498903 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +build: + ./build-and-test.sh + +clean: + -rm -rf lambda/ + -rm lambda-deploy.zip + -rm python/lambda-deploy.zip + git ls-files -o python/lambda | while read f; do rm -- "$$f"; done \ No newline at end of file diff --git a/build-and-test.sh b/build-and-test.sh index bc7309a..c0fba7c 100755 --- a/build-and-test.sh +++ b/build-and-test.sh @@ -1,9 +1,10 @@ #!/bin/bash - +set -e VERSION=$(cat VERSION) +INTERACTIVE=$(if test -t 0; then echo -i; fi) docker build . -t developmentseed/geolambda:${VERSION} -docker run --rm -v $PWD:/home/geolambda -it developmentseed/geolambda:${VERSION} package.sh +docker run --rm -v $PWD:/home/geolambda ${INTERACTIVE} -t developmentseed/geolambda:${VERSION} package.sh cd python docker build . --build-arg VERSION=${VERSION} -t developmentseed/geolambda:${VERSION}-python