Skip to content

Commit

Permalink
* updated to latest folder structure
Browse files Browse the repository at this point in the history
* updated to latest deployment scripts
  • Loading branch information
Martin Hecher committed Feb 16, 2015
1 parent d1a1ee3 commit 36df9c9
Show file tree
Hide file tree
Showing 102 changed files with 119 additions and 952 deletions.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions _devops/docker-build-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

SERVICEFILE=./service-info.txt

NAMESPACE=$(sed '1q;d' $SERVICEFILE)
IMAGENAME=$NAMESPACE/$(sed '2q;d' $SERVICEFILE)
DOCKERFILE=$(sed '3q;d' $SERVICEFILE)

echo "Building docker image '$IMAGENAME' from Dockerfile located at '$DOCKERFILE':"
echo "docker build -t $IMAGENAME $DOCKERFILE"

docker build -t $IMAGENAME $DOCKERFILE
25 changes: 25 additions & 0 deletions _devops/docker-run-container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

SERVICEFILE=./service-info.txt

NAMESPACE=$(sed '1q;d' $SERVICEFILE)
IMAGENAME=$NAMESPACE/$(sed '2q;d' $SERVICEFILE)
FOLDER=$(pwd)/$(sed '4q;d' $SERVICEFILE)

COMMAND=$1

if [ -z "$1" ]
then
COMMAND="/bin/bash"
echo "Usage ./docker-run COMMAND\n"
echo "No COMMAND provided, defaulting to '/bin/bash'\n"
fi

if [ -z "$FOLDER" ]
then
echo "Running: docker run --rm -it -P --entrypoint="$COMMAND" $IMAGENAME"
docker run --rm -it -P --entrypoint="$COMMAND" $IMAGENAME
else
echo "Running: docker run --rm -it -P -v $FOLDER:/mnt/host --entrypoint="$COMMAND" $IMAGENAME"
docker run --rm -it -P -v $FOLDER:/mnt/host --entrypoint="$COMMAND" $IMAGENAME
fi
File renamed without changes.
11 changes: 11 additions & 0 deletions _devops/serve-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

# TODO: read all necessary data from file!

SERVICENAME=$(cat ./service-info.txt)
INDEXFILE="app.js"
FOLDER="../"

#(cd $FOLDER; pm2 delete $SERVICENAME; pm2 start $INDEXFILE -x --name $SERVICENAME)
#pm2 logs
(cd $FOLDER; nodemon -w api -w config)
11 changes: 11 additions & 0 deletions _devops/serve-prod.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

# TODO: read all necessary data from file!

SERVICENAME=$(cat ./service-info.txt)
INDEXFILE="app.js"
FOLDER="../"

#(cd $FOLDER; pm2 delete $SERVICENAME; pm2 start $INDEXFILE -x --name $SERVICENAME -- --prod)
#pm2 logs
(cd $FOLDER; nodemon)
4 changes: 4 additions & 0 deletions deployment/service-info.txt → _devops/service-info.txt
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
local
microservice-base
../

../
9 changes: 9 additions & 0 deletions _devops/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

SERVICEFILE=./service-info.txt

SRC=$(sed '5q;d' $SERVICEFILE)

echo "Setting up project:"
echo " * installing dependencies: (cd $SRC && npm install && bower install)"
(cd $SRC && npm install && bower install)
15 changes: 15 additions & 0 deletions _devops/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

SERVICEFILE=./service-info.txt

SRC=$(sed '5q;d' $SERVICEFILE)

echo "Starting test suite:"
echo " * installing global dependencies: npm install -g sails\n\n"
npm install -g sails

echo "\n\n * installing local dependencies: (cd $SRC && npm -d install)\n\n"
(cd $SRC && npm -d install)

echo "\n\n * execute tests: (cd $SRC && npm test)"
(cd $SRC && npm test)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 0 additions & 6 deletions deployment/docker-build.sh

This file was deleted.

17 changes: 0 additions & 17 deletions deployment/docker-run.sh

This file was deleted.

39 changes: 32 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,48 @@
{
"name": "duraark-microservice-base",
"private": false,
"version": "0.2.3",
"version": "0.1.0",
"description": "Base docker image and initial Sails.js setup for a DURAARK microservice.",
"keywords": ["duraark", "microservice", "archiving"],
"dependencies": {},
"dependencies": {
"sails": "~0.10.2",
"sails-disk": "~0.10.0",
"rc": "~0.5.0",
"include-all": "~0.1.3",
"ejs": "~0.8.4",
"grunt": "0.4.2",
"grunt-sync": "~0.0.4",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-sails-linker": "~0.9.5",
"grunt-contrib-jst": "~0.6.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-uglify": "~0.4.0",
"grunt-contrib-cssmin": "~0.9.0",
"grunt-contrib-less": "0.11.1",
"grunt-contrib-coffee": "~0.10.1"
},
"scripts": {
"start": "node src/app.js",
"debug": "node debug src/app.js",
"test": "(cd src; grunt test)"
"start": "node app.js",
"debug": "node debug app.js",
"test": "grunt test"
},
"main": "src/app.js",
"main": "app.js",
"repository": {
"type": "git",
"url": "git://github.com/DURAARK/microservice-base.git"
},
"author": "Martin Hecher <[email protected]>",
"license": "MIT",
"devDependencies": {},
"devDependencies": {
"nodemon": "^1.2.1",
"mocha": "^2.1.0",
"grunt-mocha-test": "^0.12.6",
"sinon": "^1.12.2",
"assert": "^1.3.0",
"chai": "~1.10.0"
},
"bugs": {
"url": "https://github.com/DURAARK/microservice-base/issues"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 0 additions & 24 deletions src/.tmp/localDiskDb.db

This file was deleted.

15 changes: 0 additions & 15 deletions src/.tmp/public/styles/importer.css

This file was deleted.

Binary file removed src/assets/favicon.ico
Binary file not shown.
822 changes: 0 additions & 822 deletions src/assets/js/dependencies/sails.io.js

This file was deleted.

8 changes: 0 additions & 8 deletions src/assets/robots.txt

This file was deleted.

53 changes: 0 additions & 53 deletions src/package.json

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 36df9c9

Please sign in to comment.