-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jacques Labuschagne
committed
Apr 30, 2016
1 parent
433680b
commit 869e0bb
Showing
26 changed files
with
81 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
.*.swp | ||
*.log | ||
*.tbz2 | ||
node_modules | ||
ontario | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,24 @@ | ||
include *.mk | ||
DOCKER=docker | ||
COMPOSE=docker-compose | ||
IMAGES=downlink/reveal-sync-app downlink/reveal-sync-static | ||
|
||
.PHONY: all deploy-staging remove-staging deploy-prod remove-prod install run clean | ||
.PHONY: all images dist run clean | ||
|
||
all: $(GROUP_VARS) $(PACKAGE) | ||
@echo $(PACKAGE) | ||
all: images dist | ||
|
||
deploy-staging: $(GROUP_VARS) $(PACKAGE) | ||
cd ansible; ansible-playbook -i ./staging -K ./deploy.yml | ||
images: | ||
$(COMPOSE) build static app | ||
|
||
remove-staging: $(GROUP_VARS) | ||
cd ansible; ansible-playbook -i ./staging -K ./remove.yml | ||
dist: | ||
for i in $(IMAGES); do $(DOCKER) save -o $$(basename $$i).tar $$i; done | ||
tar -jcvf reveal-sync_$$(date +%Y-%m-%d).tbz2 reveal-sync*.tar | ||
rm -v reveal-sync*.tar | ||
@echo "*** Now copy reveal-sync*.tar.gz to your server." | ||
|
||
deploy-prod: $(GROUP_VARS) $(PACKAGE) | ||
cd ansible; ansible-playbook -i ./production -K ./deploy.yml | ||
|
||
remove-prod: $(GROUP_VARS) | ||
cd ansible; ansible-playbook -i ./production -K ./remove.yml | ||
|
||
$(GROUP_VARS): $(GROUP_VARS).pgp package.json | ||
gpg -o $@ -d $< | ||
@grep appname $(GROUP_VARS) || echo "appname: "$(NAME) >> $(GROUP_VARS) | ||
@grep version $(GROUP_VARS) || echo "version: "$(VERSION) >> $(GROUP_VARS) | ||
@grep extractdir $(GROUP_VARS) || echo "extractdir: /opt/"$(NAME)-$(VERSION) >> $(GROUP_VARS) | ||
@grep installdir $(GROUP_VARS) || echo "installdir: /opt/"$(NAME) >> $(GROUP_VARS) | ||
|
||
$(PACKAGE): package.json $(NODE_SOURCES) | ||
npm install | ||
test -f bower.json && ./node_modules/.bin/bower install || : | ||
mkdir -p build | ||
rsync -avz --include-from build-include . build/ | ||
mkdir -p $$(dirname $@) | ||
cd build && tar -jcvf ../$@ * | ||
run: | ||
$(COMPOSE) up -d | ||
$(COMPOSE) logs | ||
|
||
clean: | ||
rm -fr node_modules build $(PACKAGE) $(GROUP_VARS) | ||
$(DOCKER) rmi $$($(DOCKER) images --filter dangling=true -q) $(IMAGES) || : | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
{ | ||
"daemon": true, | ||
"daemon": false, | ||
"cluster": false, | ||
"port": 9000, | ||
"workers": 1, | ||
"pid_dir": "/tmp", | ||
"log": { | ||
"facility": "local4", | ||
"level": "info" | ||
"facility": "stdout", | ||
"level": "debug" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
version: "2" | ||
services: | ||
lb: | ||
image: dockercloud/haproxy:1.2.1 | ||
links: | ||
- static | ||
- app | ||
ports: | ||
- "8010:80" | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
static: | ||
image: downlink/reveal-sync-static | ||
restart: always | ||
build: | ||
context: . | ||
dockerfile: dockerfile-static | ||
expose: | ||
- "80" | ||
environment: | ||
VIRTUAL_HOST: "downlink.nz" | ||
app: | ||
image: downlink/reveal-sync-app | ||
restart: always | ||
build: | ||
context: . | ||
dockerfile: dockerfile-node | ||
expose: | ||
- "9000" | ||
environment: | ||
VIRTUAL_HOST: "sync.downlink.nz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM node:4.3.0 | ||
|
||
COPY index.js LICENSE package.json /opt/reveal-sync/ | ||
COPY config/ /opt/reveal-sync/config/ | ||
COPY lib/ /opt/reveal-sync/lib/ | ||
|
||
RUN cd /opt/reveal-sync && npm install | ||
|
||
WORKDIR /opt/reveal-sync | ||
|
||
CMD ["node", "./index.js"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM nginx:alpine | ||
|
||
COPY dist/reveal-sync.js /usr/share/nginx/html/js/ | ||
COPY dist/socket.io.min.1-4-5.js /usr/share/nginx/html/js/socket.io.js | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters