Skip to content

Commit

Permalink
ΔOS v0.5-alpha (#25)
Browse files Browse the repository at this point in the history
* update: Vagrantfile

* update-style: .gitignore

* init: vbox.mk

* update: yarn from vm

* add-cmd: rm, ssh, vm

* update: Makefile

* init: gulp

* add: pug support

* add: gulp clean

* prep: gulp build

* update: Gulpfile

* add: gulp build

* add: gulp lint

* fix: eslint rules

* rm: eslintignore

* rm: eslintrc & babelrc

* init: webpack support

* fix: client/index.jsx

* init: actions, components, containers, reducers

* add: immutable.js

* init: test

* swap: gitkeep -> gitignore

* add: test

* fix: pug

* flow: working on mac

* update: Makefile

* reset: vbox

* update: README.md

* update: README.md

* fixed: flow

* update: travis

* update: travis

* update: flow

* update: vagrant

* update: node.sh

* update: README.md

* update: README.md

* update: README.md

* update: README.md

* add: yarn.sh and common.sh

* add: nvm.sh

* add: docker.sh

* add: compose.sh

* add: compose.sh

* clean: namespace

* update: nginx/docker/python

* init: dejs

* run: build

* mv: common -> shared
  • Loading branch information
DeSantis authored Dec 1, 2016
1 parent a4c853e commit 95b32b2
Show file tree
Hide file tree
Showing 54 changed files with 6,240 additions and 447 deletions.
5 changes: 3 additions & 2 deletions .deosrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export MAKEFLAGS=--no-print-directory

.DEFAULT_GOAL:=all
.PHONY:all app build check chmod clean install vm yarn
.PHONY:all build chmod clean install
.SUBLIME_TARGETS:all

BASEDIR:=$(CURDIR)
Expand All @@ -10,7 +10,7 @@ LIB:=$(BASEDIR)/src
SRC:=$(BASEDIR)/src
DEOS:=$(BASEDIR)/bin/deos
PRINT:=$(BASEDIR)/bin/printm

VMCMD:="cd /vagrant; bash -i -c 'ipython --profile=vagrant'"
FILES:=.deosrc\
.editorconfig\
.gitattributes\
Expand Down Expand Up @@ -49,3 +49,4 @@ FILES:=.deosrc\
var/build/obj/.gitkeep

include src/deos/test.mk
include src/deos/vbox.mk
3 changes: 3 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[ignore]

.*/node_modules/gulp-flowtype/.*
21 changes: 15 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
*.o
*.pyc

#[dotfiles]
.DS_Store

#[dotfolders]
.nvm/
.vagrant/

app/node_modules/
node_modules/
#[files]
app/bundle.min.js*
app/index.min.html
bin/logic
npm-debug.log
yarn-error.log
bin/logic

#[folders]
app/node_modules/
node_modules/

#[wildcards]
*.o
*.pyc
58 changes: 58 additions & 0 deletions Gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/* eslint-disable import/no-extraneous-dependencies */

import gulp from 'gulp';
import babel from 'gulp-babel';
import eslint from 'gulp-eslint';
import flow from 'gulp-flowtype';
import mocha from 'gulp-mocha';
import pug from 'gulp-pug';
import rename from 'gulp-rename';

import del from 'del';
import webpack from 'webpack-stream';

import webpackConfig from './src/dejs/webpack.config.babel';
import { paths, toClean, toLint } from './src/dejs/config.paths';

gulp.task('clean', () => del(toClean));

// .pipe(eslint.failAfterError())
gulp.task('lint', ['clean'], () => gulp.src(toLint)
.pipe(eslint())
.pipe(eslint.format())
.pipe(flow({ abort: false })));

gulp.task('build', ['lint'], () => {
gulp.src(paths.files.client.js.all)
.pipe(babel())
.pipe(gulp.dest(paths.dirs.es5.client));
gulp.src(paths.files.shared.js.all)
.pipe(babel())
.pipe(gulp.dest(paths.dirs.es5.shared));
gulp.src(paths.files.render.js.all)
.pipe(babel())
.pipe(gulp.dest(paths.dirs.es5.render));
gulp.src(paths.files.server.js.all)
.pipe(babel())
.pipe(gulp.dest(paths.dirs.es5.server));
gulp.src(paths.files.test.js.all)
.pipe(babel())
.pipe(gulp.dest(paths.dirs.es5.test));
});

gulp.task('pug', () => gulp.src(paths.files.client.pug.in)
.pipe(pug({}))
.pipe(rename(paths.files.client.pug.out))
.pipe(gulp.dest(paths.dirs.dist)));

gulp.task('main', ['build', 'pug'], () => {
gulp.src(paths.files.client.js.entry)
.pipe(webpack(webpackConfig))
.pipe(gulp.dest(paths.dirs.dist));
});

gulp.task('test', () => gulp.src(paths.files.test.js.out).pipe(mocha()));

gulp.task('watch', () => gulp.watch(toLint, ['main']));

gulp.task('default', ['watch', 'main']);
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
include .deosrc

all: build; @($(DEOS) && echo)
all: vm ssh #build; @($(DEOS) && echo)

app:; electron ./app/

build: chmod check

check: deos.check; @(echo)

chmod:; @(chmod +x $(PRINT) $(DEOS))
chmod:; (chmod +x $(PRINT) $(DEOS))

clean:; -@(rm -rf node_modules/)
install:; (yarn global add electron)

down:; @(vagrant destroy DeVM)
gulp:; (yarn run gulp && yarn run test)

install:; @(yarn global add electron)
rm: vm.uninstall

vm:; @(vagrant up)
ssh: vm.ssh

yarn:; @(yarn all)
vm: vm.install
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,44 @@

### Install:

#### 1. Clone the repo:

```sh
Δ git clone git@github.com:DeSantisInc/DeOS.git
```

### Run:
#### 2. Install Virtualbox:

```sh
Δ brew cask install virtualbox
```

#### 3. Install Vagrant:

```sh
Δ brew cask install vagrant
```

#### 4. Install the Virtual Machine:

```sh
Δ make
Δ make vm
```

#### 5. Connect to the Virtual Machine:

```sh
Δ make ssh
```

#### 6. Shutdown the Virtual Machine:

```sh
Δ make rm
```

### Known Issues

If you encounter an error message like below:

```
Expand Down
102 changes: 16 additions & 86 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,91 +2,21 @@
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

config.vm.box = "ubuntu/trusty64"
config.vm.network :forwarded_port, guest:80, host:1337
config.vm.network :forwarded_port, guest:8888, host:1321
config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
config.ssh.paranoid = true
config.vm.define :DeVM do |t| end

config.vm.provision :shell, inline:<<-SHELL
apt-get update
apt-get install -y build-essential
apt-get install -y llvm
apt-get install -y clang-3.4
apt-get install -y ntp
apt-get install -y libffi-dev
apt-get install -y libssl-dev
apt-get install -y apt-transport-https
apt-get install -y ca-certificates
apt-get install -y git
SHELL

config.vm.provision :shell, inline:<<-SHELL
apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 \
--recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" \
| tee /etc/apt/sources.list.d/docker.list
apt-get update
apt-get install -y linux-image-extra-$(uname -r) \
linux-image-extra-virtual
apt-get install -y docker-engine
sudo service docker start
sudo docker run hello-world
sudo groupadd docker
sudo usermod -aG docker $USER
SHELL

config.vm.provision :shell, inline:<<-SHELL
sudo apt-get install -y nginx
rm /etc/nginx/nginx.conf
ln -s /vagrant/etc/nginx/nginx.conf /etc/nginx/nginx.conf
sudo service nginx reload
SHELL

config.vm.provision :shell, inline:<<-SHELL
apt-get install -y python2.7
apt-get install -y python-pip
apt-get install -y python-dev
apt-get install -y ipython
apt-get install -y ipython-notebook
pip install --upgrade pip
pip install --upgrade pyopenssl
pip install ndg-httpsclient
pip install pyasn1
pip install --upgrade requests[security]
pip install jupyter
pip install ipyparallel
pip install docker-compose
ipcluster nbextension enable
SHELL

config.vm.provision :shell, privileged:false, inline:<<-SHELL
ipython profile create vagrant
if ! [ -L /home/vagrant/.ipython/profile_vagrant/ipython_config.py ]; then
rm /home/vagrant/.ipython/profile_vagrant/ipython_config.py
ln -s /vagrant/src/ipython/ipython_config.py \
/home/vagrant/.ipython/profile_vagrant/ipython_config.py
fi
SHELL

config.vm.provision :shell, privileged:false, inline:<<-SHELL
cd /home/vagrant
wget -qO- https://raw.github.com/creationix/nvm/v0.32.1/install.sh | sh
export NVM_DIR="/home/vagrant/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
cd /vagrant && nvm install \
&& nvm use \
&& npm install --global yarn \
&& yarn install \
&& cd app \
&& yarn install
export PATH="$PATH:$HOME/.yarn/bin"
SHELL

config.vm.provision :shell, privileged:false, run:"always", inline:<<-SHELL
jupyter notebook --notebook-dir=/vagrant/var/notebook \
--no-browser \
--ip=0.0.0.0 &
SHELL

config.vm.box = "bento/ubuntu-16.04"
config.vm.network :forwarded_port, guest:5000, host:1335
config.vm.network :forwarded_port, guest:8888, host:1336
config.vm.network :forwarded_port, guest:80, host:1337
config.vm.provision :shell, path: "./src/devm/common.sh"
config.vm.provision :shell, path: "./src/devm/node.sh"
config.vm.provision :shell, path: "./src/devm/nvm.sh"
config.vm.provision :shell, path: "./src/devm/yarn.sh"
config.vm.provision :shell, path: "./src/devm/nginx.sh"
config.vm.provision :shell, path: "./src/devm/python.sh"
config.vm.provision :shell, path: "./src/devm/docker.sh"
config.vm.provision :shell, path: "./src/devm/compose.sh"
config.vm.provision :shell, path: "./src/devm/flask.sh"
config.vm.provision :shell, path: "./src/devm/jupyter.sh"
end
13 changes: 0 additions & 13 deletions app/index.html

This file was deleted.

55 changes: 0 additions & 55 deletions app/main.js

This file was deleted.

10 changes: 9 additions & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{
"dependencies": {
"babel-polyfill": "^6.16.0",
"bootstrap": "4.0.0-alpha.4",
"font-awesome": "^4.6.3"
"font-awesome": "^4.6.3",
"immutable": "^3.8.1",
"react": "^15.4.1",
"react-dom": "^15.4.1",
"react-redux": "^4.4.6",
"redux": "^3.6.0",
"redux-actions": "^1.1.0",
"redux-immutable": "^3.0.8"
},
"main": "main.js",
"name": "DeOS",
Expand Down
Loading

0 comments on commit 95b32b2

Please sign in to comment.