Merge branch 'modularize-ansible-roles'
This commit is contained in:
commit
9e1cc2fb90
|
@ -1,8 +1,8 @@
|
||||||
.idea/
|
.idea/
|
||||||
vagrant/.vagrant/
|
vagrant/.vagrant/
|
||||||
vagrant/hosts_vagrant
|
vagrant/hosts_vagrant
|
||||||
vagrant/playbooks/*.retry
|
vagrant/*.retry
|
||||||
vagrant/playbooks/extern_roles/
|
vagrant/external_ansible_roles/
|
||||||
|
|
||||||
node_modules/
|
node_modules/
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
113
package.json
113
package.json
|
@ -1,59 +1,58 @@
|
||||||
{
|
{
|
||||||
"name": "rookeries",
|
"name": "rookeries",
|
||||||
"version": "0.5.0-rc1",
|
"version": "0.5.0-rc1",
|
||||||
"description": "Modern web app construction kit.",
|
"description": "Modern web app construction kit.",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"coffee-script": "1.9.2",
|
"coffee-script": "1.9.2",
|
||||||
"less": "2.5.0",
|
"less": "2.5.0",
|
||||||
"react": "0.13.3",
|
"react": "0.13.3",
|
||||||
"bootstrap": "3.2.0",
|
"bootstrap": "3.2.0",
|
||||||
"react-bootstrap": "0.25.1",
|
"react-bootstrap": "0.25.1",
|
||||||
"highlight.js": "8.3.0",
|
"highlight.js": "8.3.0",
|
||||||
"marked": "0.3.3",
|
"marked": "0.3.3",
|
||||||
"superagent": "1.2.0",
|
"superagent": "1.2.0",
|
||||||
"reflux": "0.2.7",
|
"reflux": "0.2.7",
|
||||||
"browserify": "10.1.3",
|
"browserify": "10.1.3",
|
||||||
"coffee-reactify": "3.0.0",
|
"coffee-reactify": "3.0.0",
|
||||||
"font-awesome": "4.3.0",
|
"font-awesome": "4.3.0",
|
||||||
"react-fontawesome": "0.2.5",
|
"react-fontawesome": "0.2.5",
|
||||||
"react-router": "0.13.3",
|
"react-router": "0.13.3",
|
||||||
"react-codemirror": "0.1.4",
|
"react-codemirror": "0.1.4",
|
||||||
"codemirror": "5.6.0"
|
"codemirror": "5.6.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"chai": "1.9.2",
|
"chai": "1.9.2",
|
||||||
"mocha": "2.0.1",
|
"karma": "0.12.24",
|
||||||
"sinon-chai": "2.7.0",
|
"karma-browserify": "^5.0.5",
|
||||||
"react-tools": "0.13.3",
|
"karma-chai": "0.1.0",
|
||||||
"rewireify": "0.2.1",
|
"karma-coverage": "0.2.6",
|
||||||
"karma": "0.12.24",
|
"karma-mocha": "^1.0.1",
|
||||||
"karma-browserify": "4.1.2",
|
"karma-phantomjs-launcher": "^1.0.0",
|
||||||
"karma-chai": "0.1.0",
|
"mocha": "^2.4.5",
|
||||||
"karma-phantomjs-launcher": "0.1.4",
|
"rewireify": "0.2.1",
|
||||||
"karma-mocha": "0.1.9",
|
"sinon-chai": "2.7.0",
|
||||||
"karma-coverage": "0.2.6",
|
"watchify": "3.2.2"
|
||||||
"watchify": "3.2.2"
|
},
|
||||||
},
|
"repository": {
|
||||||
"repository": {
|
"type": "git",
|
||||||
"type": "git",
|
"url": "https://bitbucket.org/dorianpula/rookeries"
|
||||||
"url": "https://bitbucket.org/dorianpula/rookeries"
|
},
|
||||||
},
|
"keywords": [
|
||||||
"keywords": [
|
"react",
|
||||||
"react",
|
"flux",
|
||||||
"flux",
|
"python",
|
||||||
"python",
|
"flask",
|
||||||
"flask",
|
"web"
|
||||||
"web"
|
],
|
||||||
],
|
"author": "Dorian Pula",
|
||||||
"author": "Dorian Pula",
|
"license": "AGPL-1.0",
|
||||||
"license": "AGPL-1.0",
|
"bugs": {
|
||||||
"bugs": {
|
"url": "https://bitbucket.org/dorianpula/rookeries/issues"
|
||||||
"url": "https://bitbucket.org/dorianpula/rookeries/issues"
|
},
|
||||||
},
|
"browser": "./client/app.cjsx",
|
||||||
"browser": "./client/app.cjsx",
|
"scripts": {
|
||||||
"scripts": {
|
"test": "karma start tests/client/karma.conf.coffee",
|
||||||
"test": "karma start tests/client/karma.conf.coffee",
|
"build": "browserify -t coffee-reactify client/app.cjsx -o client/dist/rookeries.js",
|
||||||
"build": "browserify -t coffee-reactify client/app.cjsx -o client/dist/rookeries.js",
|
"watch": "watchify -t coffee-reactify client/app.cjsx -o client/dist/rookeries.js --debug --verbose"
|
||||||
"watch": "watchify -t coffee-reactify client/app.cjsx -o client/dist/rookeries.js --debug --verbose"
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
52
readme.md
52
readme.md
|
@ -6,9 +6,59 @@ A developer and designer friendly web platform for building gorgeous blogs and p
|
||||||
|
|
||||||
- Powered by Python on the server side using Flask and CouchDB.
|
- Powered by Python on the server side using Flask and CouchDB.
|
||||||
- Uses React, Reflux, CoffeeScript and LESS to build responsive single page apps.
|
- Uses React, Reflux, CoffeeScript and LESS to build responsive single page apps.
|
||||||
- Licensed under the Affero GNU Genearal Public License (AGPL) version 3.0.
|
- Licensed under the Affero GNU General Public License (AGPL) version 3.0.
|
||||||
- Heavily inspired by the [Ghost blogging platform](https://ghost.org/about/).
|
- Heavily inspired by the [Ghost blogging platform](https://ghost.org/about/).
|
||||||
|
|
||||||
**Status**
|
**Status**
|
||||||
|
|
||||||
- Builds: [ ](https://codeship.com/projects/77461)
|
- Builds: [ ](https://codeship.com/projects/77461)
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
*Rookeries* is heavily under development and once things stabilize there will be a user friendly installation guide.
|
||||||
|
In the meantime, please refer to the development guide below.
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
*Rookeries* uses the following technologies:
|
||||||
|
- Python
|
||||||
|
- NodeJS
|
||||||
|
- CoffeeScript
|
||||||
|
- GCC (for compiling some dependencies)
|
||||||
|
|
||||||
|
Make sure you have the following installed and setup before continuing:
|
||||||
|
- git
|
||||||
|
- pip
|
||||||
|
- virtualenv
|
||||||
|
- npm
|
||||||
|
|
||||||
|
comfortable using the bash shell on Linux or Mac OS X. (Window users should install bash using
|
||||||
|
[cygwin](http://cygwin.com/) or the Windows App store.)
|
||||||
|
|
||||||
|
For development and deployment you'll also need [Vagrant](https://www.vagrantup.com/) and
|
||||||
|
[Ansible](http://ansible.com/).
|
||||||
|
|
||||||
|
### Getting Started
|
||||||
|
|
||||||
|
1. Clone this repository: `git clone https://bitbucket.org/dorianpula/rookeries.git`
|
||||||
|
1. Create a virtualenv and source it: `virtualenv rookeries && source rookeries/bin/activate`
|
||||||
|
1. Install the Python/PIP dependencies: `pip install -r requirement/development.txt`
|
||||||
|
- *Ubuntu Linux*: You may need to install via `apt-get install` the following dependencies:
|
||||||
|
- python-dev
|
||||||
|
- libffi-dev
|
||||||
|
- libssl-dev
|
||||||
|
1. Install the Node/NPM dependencies: `npm install`
|
||||||
|
1. Install the global Node/NPM dependencies: `npm install -g coffee-script browserify less karma-cli`
|
||||||
|
1. Run the invoke build script to run the application: `inv server.run`
|
||||||
|
1. Navigate to the main Rookeries page in a browser: [http://localhost:5000/](http://localhost:5000/)
|
||||||
|
|
||||||
|
Use `inv -l` to list all the available commands.
|
||||||
|
|
||||||
|
### Test Deployment
|
||||||
|
|
||||||
|
You can also test the deployment of *Rookeries* to local server. You'll need to install to have
|
||||||
|
[Vagrant](https://www.vagrantup.com/). [Ansible](http://ansible.com/) should be installed in your virtualenv if
|
||||||
|
you followed the instructions above.
|
||||||
|
|
||||||
|
1. Install the Rookeries to a local Vagrant box with: `inv vagrant.install`
|
||||||
|
1. The application will be accessible via port 8080 locally: [http://localhost:8080/](http://localhost:8080/)
|
||||||
|
|
|
@ -19,7 +19,9 @@ pytest-bdd>=2.15.0
|
||||||
pytest-splinter>=1.7.0
|
pytest-splinter>=1.7.0
|
||||||
|
|
||||||
# Deployment and Automation
|
# Deployment and Automation
|
||||||
ansible>=1.8.0,<2.0.0
|
ansible>=2.0.0.0,<2.1.0
|
||||||
|
#http://releases.ansible.com/ansible/ansible-2.1.0.0-0.1.rc1.tar.gz
|
||||||
|
#-e git+git://github.com/ansible/ansible.git@devel#egg=ansible
|
||||||
ansible-vagrant>=1.2.1
|
ansible-vagrant>=1.2.1
|
||||||
invoke==0.11.1
|
invoke==0.11.1
|
||||||
virtualenv>=1.11.0
|
virtualenv>=1.11.0
|
||||||
|
|
|
@ -37,7 +37,7 @@ def package(ctx, add_date_suffix=False, package_suffix=''):
|
||||||
ctx.run('ln -s ../package.json {}/package.json'.format(packaging_dir))
|
ctx.run('ln -s ../package.json {}/package.json'.format(packaging_dir))
|
||||||
|
|
||||||
ctx.run('tar zcvhf {} {}'.format(deployable_package, packaging_dir), echo=True)
|
ctx.run('tar zcvhf {} {}'.format(deployable_package, packaging_dir), echo=True)
|
||||||
ctx['deployable'] = pathlib.Path(deployable_package).absolute()
|
ctx['deployable'] = pathlib.Path(deployable_package)
|
||||||
|
|
||||||
|
|
||||||
def generate_package_name(add_date_suffix=False, pkg_suffix=''):
|
def generate_package_name(add_date_suffix=False, pkg_suffix=''):
|
||||||
|
|
|
@ -5,6 +5,8 @@ Tasks for working with a vagrant installation for testing and development.
|
||||||
:license: AGPL v3+
|
:license: AGPL v3+
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import pathlib
|
||||||
|
|
||||||
import invoke as inv
|
import invoke as inv
|
||||||
from invoke import tasks
|
from invoke import tasks
|
||||||
|
|
||||||
|
@ -39,7 +41,7 @@ def recreate(nuke_the_box=False):
|
||||||
def install(ctx, verbose=0):
|
def install(ctx, verbose=0):
|
||||||
"""Provision the vagrant box and deploy the Rookeries on the box."""
|
"""Provision the vagrant box and deploy the Rookeries on the box."""
|
||||||
install_ansible_roles()
|
install_ansible_roles()
|
||||||
run_ansible_vagrant_playbook('playbooks/provision.yaml', verbose, deployable=ctx.get('deployable'))
|
run_ansible_vagrant_playbook('provision.yaml', verbose, deployable=ctx.get('deployable'))
|
||||||
|
|
||||||
|
|
||||||
def generate_verbosity_tag(verbosity=0):
|
def generate_verbosity_tag(verbosity=0):
|
||||||
|
@ -51,7 +53,9 @@ def generate_verbosity_tag(verbosity=0):
|
||||||
def run_ansible_vagrant_playbook(playbook, verbose, deployable=None):
|
def run_ansible_vagrant_playbook(playbook, verbose, deployable=None):
|
||||||
options = generate_verbosity_tag(verbose)
|
options = generate_verbosity_tag(verbose)
|
||||||
if deployable:
|
if deployable:
|
||||||
options += ' --extra-vars "rookeries_package_path={}"'.format(deployable)
|
deploy_source = deployable.name.replace('.tar.bz2', '')
|
||||||
|
options += ' --extra-vars "rookeries_deploy_source={} rookeries_package_path={} rookeries_"'.format(
|
||||||
|
deploy_source, deployable.absolute())
|
||||||
ansible_cmd = 'ansible-playbook-vagrant {playbook} {extra_opts}'.format(playbook=playbook, extra_opts=options)
|
ansible_cmd = 'ansible-playbook-vagrant {playbook} {extra_opts}'.format(playbook=playbook, extra_opts=options)
|
||||||
|
|
||||||
with utils.cd('vagrant'):
|
with utils.cd('vagrant'):
|
||||||
|
@ -60,10 +64,27 @@ def run_ansible_vagrant_playbook(playbook, verbose, deployable=None):
|
||||||
|
|
||||||
|
|
||||||
def install_ansible_roles():
|
def install_ansible_roles():
|
||||||
ANSIBLE_ROLE_PATH = '--roles-path=playbooks/extern_roles/'
|
EXTERNAL_ROLES_PATH = 'external_ansible_roles'
|
||||||
ANSIBLE_ROOKERIES_SCM = 'git+https://bitbucket.org/dorianpula/ansible-rookeries'
|
ANSIBLE_ROLE_PATH_PARAM = '--roles-path={}'.format(EXTERNAL_ROLES_PATH)
|
||||||
|
DEPENDENT_ROLES = {
|
||||||
|
'rookeries': 'breakout-nodejs-role',
|
||||||
|
'uwsgi-nginx-supervisor': 'split-out-nginx-supervisor-role',
|
||||||
|
'nginx-supervisor': 'split-out-nginx-supervisor-role',
|
||||||
|
'nodejs': 'master',
|
||||||
|
}
|
||||||
|
|
||||||
with utils.cd('vagrant'):
|
with utils.cd('vagrant'):
|
||||||
listing_result = inv.run('ansible-galaxy list {}'.format(ANSIBLE_ROLE_PATH))
|
external_role_folder = pathlib.Path(EXTERNAL_ROLES_PATH)
|
||||||
if 'ansible-rookeries' not in listing_result.stdout:
|
if not external_role_folder.exists():
|
||||||
inv.run('ansible-galaxy install {} {}'.format(ANSIBLE_ROLE_PATH, ANSIBLE_ROOKERIES_SCM))
|
external_role_folder.mkdir()
|
||||||
|
listing_result = inv.run('ansible-galaxy list {}'.format(ANSIBLE_ROLE_PATH_PARAM))
|
||||||
|
|
||||||
|
# if 'rookeries' not in listing_result.stdout:
|
||||||
|
# TODO Fix once either ansible galaxy 2.1.0 works properly or role changes merged into master branches.
|
||||||
|
# TODO See https://github.com/ansible/ansible/pull/10620 & https://github.com/ansible/ansible/issues/10477
|
||||||
|
# inv.run('ansible-galaxy install {} -r role_requirements.yml'.format(ANSIBLE_ROLE_PATH_PARAM))
|
||||||
|
|
||||||
|
for (role, branch) in DEPENDENT_ROLES.items():
|
||||||
|
if role not in listing_result.stdout:
|
||||||
|
git_cmd = 'git clone --branch {branch} https://bitbucket.org/dorianpula/ansible-{role} {path}/{role}'
|
||||||
|
inv.run(git_cmd.format(branch=branch, role=role, path=EXTERNAL_ROLES_PATH))
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
[defaults]
|
[defaults]
|
||||||
roles_path = playbooks/extern_roles
|
roles_path = external_ansible_roles
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
---
|
|
||||||
- hosts: all
|
|
||||||
sudo: yes
|
|
||||||
roles:
|
|
||||||
- role: ansible-rookeries
|
|
||||||
rookeries_package: rookeries-0.5.0-alpha.tar.bz2
|
|
||||||
rookeries_package_path: "../../{{ rookeries_package }}"
|
|
||||||
rookeries_deploy_source: rookeries-0.5.0-alpha
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
sudo: yes
|
||||||
|
roles:
|
||||||
|
- role: rookeries
|
||||||
|
rookeries_deploy_source: rookeries-0.5.0-alpha
|
||||||
|
rookeries_package: "{{ rookeries_deploy_source }}.tar.bz2"
|
||||||
|
rookeries_package_path: "../{{ rookeries_package }}"
|
|
@ -0,0 +1,4 @@
|
||||||
|
- src: https://bitbucket.org/dorianpula/ansible-rookeries
|
||||||
|
scm: git
|
||||||
|
name: rookeries
|
||||||
|
version: "breakout-nodejs-role"
|
Loading…
Reference in New Issue