From b09ca763332a9ec2a8899133e773f6d9866ef0cd Mon Sep 17 00:00:00 2001 From: Joe Nelson Date: Tue, 28 Oct 2014 17:35:35 -0700 Subject: [PATCH 1/2] Add optimization and s3 release script --- dbapi.cabal | 4 ++-- scripts/release_s3.sh | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100755 scripts/release_s3.sh diff --git a/dbapi.cabal b/dbapi.cabal index 7de9ec196..2bdeeaf9e 100644 --- a/dbapi.cabal +++ b/dbapi.cabal @@ -1,5 +1,5 @@ name: dbapi -version: 0.2.4.1 +version: 0.2.4.2 synopsis: The database is your api license: MIT license-file: LICENSE @@ -11,7 +11,7 @@ cabal-version: >=1.10 executable dbapi main-is: Main.hs - ghc-options: -Wall -W -Werror + ghc-options: -Wall -W -Werror -O2 default-language: Haskell2010 build-depends: base >=4.6 && <5 , HDBC, HDBC-postgresql diff --git a/scripts/release_s3.sh b/scripts/release_s3.sh new file mode 100755 index 000000000..328a03d02 --- /dev/null +++ b/scripts/release_s3.sh @@ -0,0 +1,10 @@ +export DBAPI_VER=`grep ^version /app/dbapi.cabal | sed -En 's/.*\s+([0-9\.]+)/\1/p'` + +curl -L http://softlayer-ams.dl.sourceforge.net/project/s3tools/s3cmd/1.5.0-alpha1/s3cmd-1.5.0-alpha1.tar.gz | tar zx + +cp /app/dist/build/dbapi/dbapi dbapi-${DBAPI_VER} +tar cJf dbapi-${DBAPI_VER}.tar.xz dbapi-${DBAPI_VER} + +touch ~/.s3cfg + +s3cmd-1.5.0-alpha1/s3cmd put --access_key=${S3_ACCESS_KEY} --secret_key=${S3_SECRET_KEY} -P -f dbapi-${DBAPI_VER}.tar.xz $S3_BUCKET/dbapi-${DBAPI_VER}.tar.xz From 5453e1988c58d93a85274505559ef7385a06dee5 Mon Sep 17 00:00:00 2001 From: Joe Nelson Date: Tue, 28 Oct 2014 20:05:15 -0700 Subject: [PATCH 2/2] Document heroku build --- README.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 66585ff16..57909d494 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,15 @@ createdb -O dbapi_test -U postgres dbapi_test cabal test --show-details=always --test-options="--color" ``` -### Accessing server on localhost +### Distributing Heroku build -Dbapi permits only secure https access. By default it uses a -self-signed key which will cause Chrome and other rest clients to -complain. You will need to configure your system to trust this key. -On mac follow [these -instructions](http://www.robpeck.com/2010/10/google-chrome-mac-os-x-and-self-signed-ssl-certificates/). +```sh +heroku create --stack=cedar --buildpack https://github.com/begriffs/heroku-buildpack-ghc.git +git push heroku master + +heroku config:set S3_ACCESS_KEY=abc +heroku config:set S3_SECRET_KEY=123 +heroku config:set S3_BUCKET=s3://foo/bar + +heroku run scripts/release_s3.sh +```