Merge branch 'hillct-feature/dockerHooks' into 0.5

This commit is contained in:
hillct 2016-12-01 01:30:19 -05:00
commit b13000c40c
6 changed files with 51 additions and 6 deletions

View File

@ -1,3 +1,24 @@
FROM node:6-onbuild FROM alpine:edge
# Build-time metadata as defined at http://label-schema.org
ARG BUILD_DATE
ARG VCS_REF
ARG VCS_URL
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="Gun - Offline First, Javascript Graph Database" \
# org.label-schema.description="Let it be pulled from Readme.md..." \
org.label-schema.url="http://gun.js.org" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url=$VCS_URL \
org.label-schema.vendor="The Gun Database Team" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0"
WORKDIR /app
ADD . .
ENV NPM_CONFIG_LOGLEVEL warn ENV NPM_CONFIG_LOGLEVEL warn
RUN apk update && apk upgrade \
&& apk add --no-cache ca-certificates nodejs \
&& npm install \
&& rm -rf /var/cache/* -rf /tmp/npm*
EXPOSE 8080 EXPOSE 8080
CMD ["npm","start"]

View File

@ -55,8 +55,8 @@ Try the [interactive tutorial](http://gun.js.org/think.html) in the browser (**5
- To quickly spin up a Gun test server for your development team, uilize eiher [Heroku](http://heroku.com) or [Docker](http://docker.com) or any variant thereof ([Dokku](http://dokku.viewdocs.io/dokku/), [Flynn.io](http://flynn.io), [now.sh](https://zeit.co/now), etc) - To quickly spin up a Gun test server for your development team, uilize eiher [Heroku](http://heroku.com) or [Docker](http://docker.com) or any variant thereof ([Dokku](http://dokku.viewdocs.io/dokku/), [Flynn.io](http://flynn.io), [now.sh](https://zeit.co/now), etc)
### [Docker](https://www.docker.com/) ### [Docker](https://www.docker.com/)
- Either (fastest) from the [Docker Hub](https://hub.docker.com/r/gundb/gun/): - Either (fastest) from the [Docker Hub](https://hub.docker.com/r/gundb/gun/)(Built at [![](https://images.microbadger.com/badges/commit/gundb/gun.svg)](https://microbadger.com/images/gundb/gun "Get your own commit badge on microbadger.com")):
```bash ```bash
docker run -p 8080:8080 gundb/gun docker run -p 8080:8080 gundb/gun
@ -69,6 +69,15 @@ Try the [interactive tutorial](http://gun.js.org/think.html) in the browser (**5
docker build -t myrepo/gundb:v1 . docker build -t myrepo/gundb:v1 .
docker run -p 8080:8080 myrepo/gundb:v1 docker run -p 8080:8080 myrepo/gundb:v1
``` ```
<<<<<<< HEAD
=======
- Or, if you prefer your Docker image with metadata labels (Linux/Mac only):
```bash
npm run docker
docker run -p 8080:8080 usenameHere/gun:git
```
>>>>>>> 6b78b2ee91fc3442fe0976812db868cdd49b4709
Then visit [http://localhost:8080](http://localhost:8080) in your browser. Then visit [http://localhost:8080](http://localhost:8080) in your browser.
### [Heroku](https://www.heroku.com/) ### [Heroku](https://www.heroku.com/)
@ -119,7 +128,7 @@ Designed with ♥ by Mark Nadal, the gun team, and many amazing contributors. L
Thanks to the following people who have contributed to GUN, via code, issues, or conversation (this list has quickly become tremendously behind! We'll probably turn this into a dedicated wiki page so you can add yourself): Thanks to the following people who have contributed to GUN, via code, issues, or conversation (this list has quickly become tremendously behind! We'll probably turn this into a dedicated wiki page so you can add yourself):
[agborkowski](https://github.com/agborkowski); [alexlafroscia](https://github.com/alexlafroscia); [anubiann00b](https://github.com/anubiann00b); [bromagosa](https://github.com/bromagosa); [coolaj86](https://github.com/coolaj86); [d-oliveros](https://github.com/d-oliveros), [danscan](https://github.com/danscan); **[forrestjt](https://github.com/forrestjt) ([file.js](https://github.com/amark/gun/blob/master/lib/file.js))**; [gedw99](https://github.com/gedw99); [HelloCodeMing](https://github.com/HelloCodeMing); **[JosePedroDias](https://github.com/josepedrodias) (graph visualizer)**; **[jveres](https://github.com/jveres) ([todoMVC](https://github.com/jveres/todomvc) [live demo](http://todos.loqali.com/))**; [ndarilek](https://github.com/ndarilek); [onetom](https://github.com/onetom); [phpnode](https://github.com/phpnode); [PsychoLlama](https://github.com/PsychoLlama); **[RangerMauve](https://github.com/RangerMauve) ([schema](https://github.com/gundb/gun-schema))**; [riston](https://github.com/riston); [rootsical](https://github.com/rootsical); [rrrene](https://github.com/rrrene); [ssr1ram](https://github.com/ssr1ram); [Xe](https://github.com/Xe); [zot](https://github.com/zot); [agborkowski](https://github.com/agborkowski); [alexlafroscia](https://github.com/alexlafroscia); [anubiann00b](https://github.com/anubiann00b); [bromagosa](https://github.com/bromagosa); [coolaj86](https://github.com/coolaj86); [d-oliveros](https://github.com/d-oliveros), [danscan](https://github.com/danscan); **[forrestjt](https://github.com/forrestjt) ([file.js](https://github.com/amark/gun/blob/master/lib/file.js))**; [gedw99](https://github.com/gedw99); [HelloCodeMing](https://github.com/HelloCodeMing); **[Hillct](https://github.com/hillct) (Deployment Tools); **[JosePedroDias](https://github.com/josepedrodias) (graph visualizer)**; **[jveres](https://github.com/jveres) ([todoMVC](https://github.com/jveres/todomvc) [live demo](http://todos.loqali.com/))**; [ndarilek](https://github.com/ndarilek); [onetom](https://github.com/onetom); [phpnode](https://github.com/phpnode); [PsychoLlama](https://github.com/PsychoLlama); **[RangerMauve](https://github.com/RangerMauve) ([schema](https://github.com/gundb/gun-schema))**; [riston](https://github.com/riston); [rootsical](https://github.com/rootsical); [rrrene](https://github.com/rrrene); [ssr1ram](https://github.com/ssr1ram); [Xe](https://github.com/Xe); [zot](https://github.com/zot);
[ayurmedia](https://github.com/ayurmedia); [ayurmedia](https://github.com/ayurmedia);
This list of contributors was manually compiled and alphabetically sorted. If we missed you, please submit an issue so we can get you added! This list of contributors was manually compiled and alphabetically sorted. If we missed you, please submit an issue so we can get you added!

7
hooks/build Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
FOO=${IMAGE_NAME:=`whoami`/gun:git-local}
BAR=${SOURCE_BRANCH:=`git rev-parse --abbrev-ref HEAD`}
docker build --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg VERSION=$SOURCE_BRANCH -t $IMAGE_NAME .

3
hooks/post_push Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
docker tag $IMAGE_NAME $DOCKER_REPO:latest
docker push $DOCKER_REPO:latest

View File

@ -5,8 +5,9 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"start": "node examples/http.js 8080", "start": "node examples/http.js 8080",
"prepublish": "uglifyjs2 gun.js -o gun.min.js -c -m", "prepublish": "npm run unbuild && uglifyjs gun.js -o gun.min.js -c -m",
"test": "mocha", "test": "mocha",
"docker": "hooks/build",
"unbuild": "node lib/unbuild.js" "unbuild": "node lib/unbuild.js"
}, },
"repository": { "repository": {
@ -54,6 +55,6 @@
"mocha": "~>1.9.0", "mocha": "~>1.9.0",
"panic-server": "~>0.3.0", "panic-server": "~>0.3.0",
"selenium-webdriver": "~>2.53.2", "selenium-webdriver": "~>2.53.2",
"uglify-js2": "^2.1.11" "uglify-js": "^2.2.0"
} }
} }

4
src/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore