Skip to content

Commit

Permalink
Merge pull request #56 from titouanfreville/development
Browse files Browse the repository at this point in the history
merge dev to master
  • Loading branch information
Clément L authored Jun 25, 2017
2 parents bce5838 + 52d615b commit cf09e3e
Show file tree
Hide file tree
Showing 183 changed files with 16,813 additions and 1,616 deletions.
36 changes: 36 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# VERSION DEFINITI>ONS #########
# Miimal docker-compose version
COMPOSE_REQUIRE=1.8.1
# ------------------------------
# Minimal docker version -------
DOCKER_REQUIRE=1.12.5
# ------------------------------
################################
# ------------------------------
# PORT DEFINITION ##############
# Default port used by the front
PORT=80
# Default port used by the api
API_PORT=3000
# ------------------------------
################################
# DOCKER COMPOSE VARIABLES #####
# Watching in containers -------
WATCHING=0
# ------------------------------
# Debug in containers ----------
DEBUG=1
# ------------------------------
# MariaDB values ---------------
MYSQL_ROOT_PASSWORD=popcube_dev
MYSQL_ROOT_PASSWORD=popcube_dev
MYSQL_DATABASE=popcube_test
MYSQL_USER=test_user
MYSQL_PASSWORD=test
# ------------------------------
################################
# RUNNING CONTAINER VARS #######
# Default user uid to avoir root
# files from containers.
POPCUBE_USER=1000
#################################
31 changes: 31 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# VERSION DEFINITI>ONS #########
# Miimal docker-compose version
COMPOSE_REQUIRE=1.8.1
# ------------------------------
# Minimal docker version -------
DOCKER_REQUIRE=1.12.5
# ------------------------------
################################
# ------------------------------
# PORT DEFINITION ##############
# Default port used by the front
PORT=80
# Default port used by the api
API_PORT=80
# ------------------------------
################################
# DOCKER COMPOSE VARIABLES #####
# Watching in containers -------
WATCHING=1
SET_EXIT_STATUS=0
# ------------------------------
# Debug in containers ----------
DEBUG=1
# ------------------------------
# MariaDB values ---------------
MYSQL_ROOT_PASSWORD=popcube_dev
MYSQL_DATABASE=popcube_test
MYSQL_USER=test_user
MYSQL_PASSWORD=test
# ------------------------------
################################
17 changes: 16 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ _testmain.go
*.exe
*.test
*.prof

bin
pkg
src
go/src/github.com/*
!go/src/github.com/titouanfreville
golang.org
gopkg.in
sourcegraph.com

# Workbench
*.bak

.env
.env.old

# Docs
docs/*_documentation.html
coverage/*
66 changes: 23 additions & 43 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,28 @@
sudo: required

language: bash
env:
DOCKER_COMPOSE_VERSION: 1.9.0

before_install:
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin

services:
- docker

dist: trusty
language: node_js - "7.7.2"
cache:
directories:
- app/node_modules
script:
- docker login -u="$DOCKER_USER" -p="$DOCKER_PWD" $DOCKER_REGISTRY
- docker build -t $DOCKER_REGISTRY/go:base -f docker/go_base.Dockerfile .
- docker build -t go_test -f docker/go_test.Dockerfile .
- docker build -t nginx_front -f docker/nginx_front.Dockerfile .
- docker run --rm -e WATCHING=1 go_test

- npm install electron electron-packager -g
- cd app; npm install; cd ..;
- electron-packager app Popcube --platform=darwin --arch=x64 --icon=logo/app.ico --overwrite
- electron-packager app Popcube --platform=linux --arch=x64 --icon=logo/app.ico --overwrite
- zip -r Popcube-linux-x64.zip Popcube-linux-x64
- zip -r Popcube-darwin-x64.zip Popcube-darwin-x64
after_success:
- >-
if [ "$TRAVIS_BRANCH" == "master" ]; then
docker login -u="$DOCKER_USER" -p="$DOCKER_PWD" $DOCKER_REGISTRY;
docker build -t go_base -f docker/go_base.Dockerfile .;
docker tag go_base $DOCKER_REGISTRY/go:base;
docker push $DOCKER_REGISTRY/go:base;
docker build -t nginx_front -f docker/go_base.Dockerfile .;
docker tag nginx_front $DOCKER_REGISTRY/nginx_front:latest;
docker push $DOCKER_REGISTRY/nginx_front:latest;
curl -X POST --header "Content-Type: application/json" --header "X-AUTH-TOKEN: ${DEPLOY_TOKEN}" -d '{ "Image": "registry.le-corre.eu:5000/nginx_front:latest", "ExposedPorts": { "80/tcp" : {} }, "HostConfig":{ "PortBindings": { "80/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "8080" } ] } }, "Hostname": "nginx_front" }' http://${DEPLOY_URL}/deploy;
fi
- >-
if [ "$TRAVIS_BRANCH" == "development" ]; then
docker login -u="$DOCKER_USER" -p="$DOCKER_PWD" $DOCKER_REGISTRY;
docker build -t go_base -f docker/go_base.Dockerfile .;
docker tag go_base $DOCKER_REGISTRY/go:base-dev;
docker push $DOCKER_REGISTRY/go:base-dev;
docker build -t nginx_front -f docker/go_base.Dockerfile .;
docker tag nginx_front $DOCKER_REGISTRY/nginx_front:dev;
docker push $DOCKER_REGISTRY/nginx_front:dev;
curl -X POST --header "Content-Type: application/json" --header "X-AUTH-TOKEN: ${DEPLOY_TOKEN}" -d '{ "Image": "registry.le-corre.eu:5000/nginx_front:dev", "ExposedPorts": { "80/tcp" : {} }, "HostConfig":{ "PortBindings": { "80/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "8081" } ] } }, "Hostname": "nginx_front-dev" }' http://${DEPLOY_URL}/deploy;
fi
- if [ "$TRAVIS_BRANCH" == "master" ]; then fi
- if [ "$TRAVIS_BRANCH" == "development" ]; then fi
deploy:
provider: releases
api_key:
secure: lKLjNdNl9TtZWgOWXnNzgPIen+2RzgqGp3mQyg+ZzBFXnW+NNhmYAa49LxdAkm1IaksmiDvO/oiqz+AloIOPq3iggJ/0XMJgkvHfPVFp8lxNJj+VyfZRCGcWazJCYR+fmpwranCd2yPNF+mPfMBbIhn6h+ZMQMi+8bQMiEQvpp66yLck544d+fBCzqIpJNvN41TGJ4Smlh5kOdXEQen1ZKytXM1Hzk9Jj6TT9Q8aTI1erJRFPH7+qPMsnL7+kknqaMx2pOditgmnMXZh94hfOuyD/jVhnrlvx4mk38VPSeuy2SaDdvKyz9wpcSOb2DZ79WljkFxGpkX66ufyp5QXcELMbNQz4/hXoBBl4hAK85p6JKOKYbNr1bNiUNGxQ/avh0wkS0lgSPuBd0B9fSYkUdo+l8tnIGUCRpAI1wyZdbu1pKYrL8WLs72M5ABjNHQV0iNJkK8ebZVxgLLr05ow7DH+dPgz18zGPYkyCM1syF4BDXdUGqeL4N8Pz2od3wATfrMi90VifvcMdktrZFRVYDRdCw1khYpgdYJEnc85IGYPR3knx/ZbxCs1fHTTtk5TtcJBa3RaztbsDUBbbqkOafd+vXUikLFBLsz9u7aXRObMdNe6KUyz4c/dE60elxBdOxue3vOYlDhFOkPwdgD4bLWouBrE0IKH0tcPcXyBXeA=
file:
- "Popcube-darwin-x64.zip"
- "Popcube-linux-x64.zip"
skip_cleanup: true
on:
tags: true
notifications:
slack: societyco:T1mHeYKrOtopvRjIZ68MqOQo
7 changes: 0 additions & 7 deletions api/main.go

This file was deleted.

13 changes: 13 additions & 0 deletions app/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
64 changes: 64 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

#Travis
.travis

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Users Environment Variables
.lock-wscript

# OS generated files #
.DS_Store
ehthumbs.db
Icon?
Thumbs.db

# Node Files #
/node_modules
/bower_components

# Coverage #
/coverage/

# Typing #
/src/typings/tsd/
/typings/
/tsd_typings/

# Dist #
/dist
/public/__build__/
/src/*/__build__/
__build__/**
.webpack.json

# Doc #
/doc/

# IDE #
.idea/
*.swp

# Generated packages
App-*

# vscode for now
.vscode
22 changes: 22 additions & 0 deletions app/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
language: node_js
sudo: false
install:
- export DISPLAY=':99.0'
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- npm install
script:
- npm run ci
node_js:
- "6"
- "5"
- "4"
env:
- CXX=g++-4.8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- xvfb

21 changes: 21 additions & 0 deletions app/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016 Preboot team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
37 changes: 37 additions & 0 deletions app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# PopCube

[![Build Status](https://travis-ci.org/bertofer/angular2-electron.svg?branch=master)](https://travis-ci.org/bertofer/angular2-webpack-electron)
[![Dependency Status](https://david-dm.org/bertofer/angular2-electron.svg)](https://david-dm.org/bertofer/angular2-electron)
[![devDependency Status](https://david-dm.org/bertofer/angular2-electron/dev-status.svg)](https://david-dm.org/bertofer/angular2-electron#info=devDependencies)

Forked originally from https://github.com/preboot/angular2-webpack

PopCube is an Electron Angular 2 application for the end project of Supinfo.

## What we were asked to do
- Run on Linux/Mac/Windows
- Can tchat to other users
- Using VoIp to call one or more user(s)
- Video call to one or more user(s)
- Using customisable bot

## What we did so far
- [x] Run on Linux/Mac/Windows
- [ ] Can tchat
- [ ] Can call
- [ ] Can video call
- [ ] Creating Bot

## Require
- npm v 4+
- Node v 7.7+

## Start the project

```
npm install
```

```
npm start
```
56 changes: 56 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
const electron = require('electron')
const livereload = require('electron-connect').client
// Module to control application life.
const app = electron.app
// Module to create native browser window.
const BrowserWindow = electron.BrowserWindow

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
const npmLifecycle = process.env.npm_lifecycle_event
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({width: 800, height: 600, frame: false,})

// and load the index.html of the app.
mainWindow.loadURL(`file://${__dirname}/dist/index.html`)
//mainWindow.setMenu(null)

if (npmLifecycle === 'start-watch') {
livereload.create(mainWindow)
}

// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', createWindow)

// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})

app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})

// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.
Loading

0 comments on commit cf09e3e

Please sign in to comment.