Skip to content

Commit

Permalink
firs commit
Browse files Browse the repository at this point in the history
  • Loading branch information
imathews committed Oct 10, 2015
0 parents commit 305a49d
Show file tree
Hide file tree
Showing 3,147 changed files with 710,571 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
keys.json
.idea
.idea/*
public/javascripts/*
public/stylesheets/*

public/images/collections
public/images/maps
public/images/models
public/images/users
public/images/visualizations

filesystem/*
!filesystem/.keep
npm-debug.log
*.map
110 changes: 110 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
module.exports = function(grunt) {

var fs = require('fs');

//grunt.initConfig({});

require('load-grunt-tasks')(grunt);

grunt.config.init({
pkg: grunt.file.readJSON('package.json'),
date: grunt.template.date(new Date(), 'yyyy-mm-dd,HH.MM.ss'),
exec: {
clearAssets: 'rm -rf public/javascripts/* && rm -rf public/stylesheets/*'
},
sshexec: {
options: {
privateKey: '<%= grunt.file.read(grunt.config.get("pemPath")) %>',
host: '<%= grunt.config.get("hostname") %>',
username: "ec2-user"
},
unzip: {
command: "cd ~/redivis/releases/" + "<%=date%>" + " && tar -zxvf archive.tar.gz && rm archive.tar.gz"
},
removeOldPublicAssets: {
command: "rm -rf ~/redivis/public/{stylesheets,javascripts,icons,images/defaults,images/general}"
},
movePublicAssets: {
command: "cp -ar ~/redivis/current/public/{icons,javascripts,stylesheets,fonts} ~/redivis/public && " +
"cp -ar ~/redivis/current/public/images/{general,defaults} ~/redivis/public/images && " +
"rm -rf ~/redivis/current/public && ln -s ~/redivis/public ~/redivis/current/public"
},
setDevelopment: {
command: "export NODE_ENV='development'"
},
reload: {
command: "sudo service pm2 restart"
},
'makeReleaseDir': {
command: "mkdir -m 777 -p ~/redivis/releases/<%=date%> && ln -s ~/redivis/node_modules/ ~/redivis/releases/<%=date%>"
},
removeOldReleases : {
command:"cd ~/redivis/releases/ && ls -t | sed -e '1,5d' | xargs -d '\\n' sudo rm -r"
},
'updateSymLinks': {
command: "sudo rm -rf ~/redivis/current && ln -s ~/redivis/releases/" + '<%=date%>' + " ~/redivis/current && ln -s ~/redivis/filesystem ~/redivis/current/"
},
'npmInstall': {
command: "cd ~/redivis/current && npm install --production"
}
},
sftp: {
deploy: {
files: {
"./": "archive.tar.gz"
},
options: {
host: '<%= grunt.config.get("hostname") %>',
username: "ec2-user",
privateKey: '<%= grunt.file.read(grunt.config.get("pemPath")) %>',
path: '/home/ec2-user/redivis/releases/' + '<%=date%>',
srcBasePath: "./",
showProgressBar: true
}
}
},
compress: {
main: {
options: {
archive: './archive.tar.gz',
mode: 'tgz'
},
files: [
{src:
['./bin/**', './config.js', './sockets/**',
'./app.js', './pm2Config.json', './package.json'],
dest: './'
}
]
}
}
});

grunt.registerTask('cleanUp', function(){
grunt.file.delete('archive.tar.gz')
grunt.task.run('exec:clearAssets')
});

var tasks = [
'compress:main', 'sshexec:makeReleaseDir',
'sftp:deploy', 'sshexec:unzip',
'sshexec:updateSymLinks',
'sshexec:npmInstall', 'sshexec:setDevelopment',
'sshexec:reload', 'sshexec:removeOldReleases', 'cleanUp'
];


grunt.registerTask('deploy', function(){
grunt.config.set('pemPath', '/Users/Ian/.ssh/redivis_staging.pem');
grunt.config.set('hostname', 'staging.redivis.com');

tasks.forEach(function(task){
grunt.task.run(task);
})
});





};
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Redivis
### Data. (re)Imagined.

#### Srsly.
27 changes: 27 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
if (process.env.NODE_ENV === undefined) process.env.NODE_ENV = 'development';

var http = require('http'),
redis = require('redis'),
io = require('socket.io')
;

var config = require('./config')[process.env.NODE_ENV],
redisCache = redis.createClient(config.redis.cache.port, config.redis.cache.host, {return_buffers: true})
;

redisCache.select(4);

var socket = io(process.argv[2] || 8080);

module.exports = {
io: socket,
redisCache: redisCache
};

require('./sockets/router')(socket);





console.log('hello world');
3 changes: 3 additions & 0 deletions bin/www
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env node
var debug = require('debug')('redivis');
var app = require('../app');
144 changes: 144 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
var redivisPackage = require('./package.json');

module.exports = {
local: {
redis : {
session:{
host: 'localhost',
port: 6379,
db: 0
},
cache: {
host: 'localhost',
port: 6379,
db: 3
},
series: {
host: 'localhost',
port: 6379,
db: 1
},
timepoints: {
host: 'localhost',
port: 6379,
db: 2
}
},
postgres:{
host: '',
database: '',
user: '',
password: '',
port: ''
},
publicRoot: '/'
},
development : {
redis : {
session:{
host: 'test.redivis.com',
port: 6379,
db: 0
},
cache: {
host: 'test.redivis.com',
port: 6379,
db: 0
},
series: {
host: 'test.redivis.com',
port: 6379,
db: 1
},
timepoints: {
host: 'test.redivis.com',
port: 6379,
db: 2
}
},
publicRoot: '/',
versionString: ''
},
test: {
redis : {
session:{
host: 'redivis-global.ubbxey.0001.usw1.cache.amazonaws.com',
port: 6379,
db: 0
},
cache: {
host: 'redivis-global.ubbxey.0001.usw1.cache.amazonaws.com',
port: 6379,
db: 4
},
series: {
host: 'redivis-global.ubbxey.0001.usw1.cache.amazonaws.com',
port: 6379,
db: 1
},
timepoints: {
host: 'redivis-global.ubbxey.0001.usw1.cache.amazonaws.com',
port: 6379,
db: 2
}
},
publicRoot: '/',
versionString: redivisPackage.hash + '.'
},
staging: {
redis : {
session:{
host: 'redivis-global.ubbxey.0001.usw1.cache.amazonaws.com',
port: 6379,
db: 0
},
cache: {
host: 'redivis-global.ubbxey.0001.usw1.cache.amazonaws.com',
port: 6379,
db: 3
},
series: {
host: 'redivis-global.ubbxey.0001.usw1.cache.amazonaws.com',
port: 6379,
db: 1
},
timepoints: {
host: 'redivis-global.ubbxey.0001.usw1.cache.amazonaws.com',
port: 6379,
db: 2
}
},
publicRoot: 'https://redivis.s3.amazonaws.com/',
versionString: redivisPackage.version + '/'
},
production: {
redis : {
session:{
host: 'redivis-global.ubbxey.0001.usw1.cache.amazonaws.com',
port: 6379,
db: 0
},
cache: {
host: 'redivis-global.ubbxey.0001.usw1.cache.amazonaws.com',
port: 6379,
db: 3
},
series: {
host: 'redivis-global.ubbxey.0001.usw1.cache.amazonaws.com',
port: 6379,
db: 1
},
timepoints: {
host: 'redivis-global.ubbxey.0001.usw1.cache.amazonaws.com',
port: 6379,
db: 2
}
},
publicRoot: 'https://redivis.s3.amazonaws.com/',
versionString: redivisPackage.version + '/'
}




};
29 changes: 29 additions & 0 deletions http/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="description" content="Data. (re)Imagined.">
<title>
Castilleja Rocks!!
</title>

<link href="vendor/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="vendor/bootstrap/css/bootstrap-theme.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">

<script src="vendor/js/socket_io.js"></script>
<script src="vendor/js/jquery-2.1.4.js"></script>
<script src="vendor/bootstrap/js/bootstrap.js"></script>
<script src="vendor/js/library.js"></script>

<script src="script.js"></script>

</head>

<body>
<h2> Hello World</h2>
</body>


</html>
3 changes: 3 additions & 0 deletions http/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
castaHacks.set({test: 'world'}, function(){
console.log(arguments);
})
Empty file added http/style.css
Empty file.
Loading

0 comments on commit 305a49d

Please sign in to comment.