From 5f5b34db274c3a4993fa10f5fd45ed2dbacce231 Mon Sep 17 00:00:00 2001 From: TJ Date: Fri, 21 Nov 2014 21:16:27 -0800 Subject: [PATCH 1/2] Updated angularjs requires $location:nobase https://gist.github.com/lpsBetty/714c93492ab4d535d105 --- public/js/routes/auth.js | 8 ++++++-- public/js/routes/routes.js | 7 +++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/public/js/routes/auth.js b/public/js/routes/auth.js index 8bd741a0..338c5a0b 100644 --- a/public/js/routes/auth.js +++ b/public/js/routes/auth.js @@ -2,7 +2,11 @@ define([ 'app' ], function(app) { app.config(function($stateProvider, $urlRouterProvider, $locationProvider, $couchPotatoProvider) { - $locationProvider.html5Mode(true); + $locationProvider.html5Mode({ + enabled: true, + requireBase: false + }) + $urlRouterProvider.otherwise('/'); @@ -16,4 +20,4 @@ define([ } }) }); -}); \ No newline at end of file +}); diff --git a/public/js/routes/routes.js b/public/js/routes/routes.js index afc12445..d3a0f906 100644 --- a/public/js/routes/routes.js +++ b/public/js/routes/routes.js @@ -7,7 +7,10 @@ define([ 'services/playbooks' ], function(app, io) { app.config(function($stateProvider, $urlRouterProvider, $locationProvider, $couchPotatoProvider) { - $locationProvider.html5Mode(true); + $locationProvider.html5Mode({ + enabled: true, + requireBase: false + }) $urlRouterProvider.otherwise(''); @@ -33,4 +36,4 @@ define([ user.getUser(function() {}); playbooks.getPlaybooks(function() {}); }) -}) \ No newline at end of file +}) From 7ebcb6725cebbc59365ff7ed7d4194aac0e4251b Mon Sep 17 00:00:00 2001 From: TJ Date: Sat, 22 Nov 2014 00:14:08 -0800 Subject: [PATCH 2/2] Add a vagrant setup with ansible --- Vagrantfile | 14 ++++++++++- playbooks/playbook.yml | 45 ++++++++++++++++++++++++++++++++++ playbooks/run_semaphore | 4 +++ playbooks/run_semaphore_log.j2 | 2 ++ 4 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 playbooks/playbook.yml create mode 100644 playbooks/run_semaphore create mode 100644 playbooks/run_semaphore_log.j2 diff --git a/Vagrantfile b/Vagrantfile index fef66222..e46e1b82 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -4,11 +4,23 @@ VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - config.vm.box = "hashicorp/precise32" + config.vm.box = "ubuntu/trusty64" config.vm.network :forwarded_port, guest: 3000, host: 3000 config.vm.provider "virtualbox" do |vb| # vb.gui = true vb.customize ["modifyvm", :id, "--memory", "512"] end + + config.vm.provider :lxc do |lxc, override| + override.vm.box = "trusty64-lxc" + override.vm.box_url = "https://vagrantcloud.com/fgrehm/boxes/trusty64-lxc/versions/2/providers/lxc.box" + lxc.backingstore = "btrfs" + end + + config.vm.provision :ansible do |ansible| + ansible.playbook = "playbooks/playbook.yml" + ansible.sudo = true + ansible.extra_vars = { ansible_ssh_user: 'vagrant' } + end end diff --git a/playbooks/playbook.yml b/playbooks/playbook.yml new file mode 100644 index 00000000..4a7a7e69 --- /dev/null +++ b/playbooks/playbook.yml @@ -0,0 +1,45 @@ +--- +- hosts: all + gather_facts: true + vars: + username: semaphore + homedir: /opt/semaphore + logdir: /var/log/semaphore + sudo: true + tasks: + - user: name={{ username }} + - apt_repository: repo='ppa:ansible/ansible' + + - name: install required packages + apt: name={{ item }} state=present update_cache=yes + with_items: + - git + - nodejs + - npm + - mongodb-server + - redis-server + - ansible + - runit + - npm: name={{ item }} global=yes + with_items: + - grunt-cli + - bower + - git: repo=https://github.com/tjheeta/semaphore dest={{ homedir }} + - file: src=/usr/bin/nodejs dest=/usr/bin/node state=link + - shell: bower install --allow-root && npm install > {{ homedir }}/somelog.txt + args: + chdir: "{{ homedir }}" + creates: "{{ homedir }}/somelog.txt" + - shell: chown -R {{ username }} {{ homedir }} + + # copy over the example credentials + - shell: cp -p {{ homedir }}/lib/credentials.example.json {{ homedir }}/lib/credentials.json + + # Setup runit and logging to /var/log/runit_semaphore + - file: path={{ homedir }}/runit_semaphore/log state=directory + - file: path={{ logdir }} state=directory owner={{ username }} + - copy: src=run_semaphore dest={{ homedir }}/runit_semaphore/run mode=0755 + - template: src=run_semaphore_log.j2 dest={{ homedir }}/runit_semaphore/log/run mode=0755 + - file: src={{ homedir }}/runit_semaphore dest=/etc/service/runit_semaphore state=link + + diff --git a/playbooks/run_semaphore b/playbooks/run_semaphore new file mode 100644 index 00000000..9f32f4e2 --- /dev/null +++ b/playbooks/run_semaphore @@ -0,0 +1,4 @@ +#!/bin/bash + +cd /opt/semaphore/ +exec grunt serve diff --git a/playbooks/run_semaphore_log.j2 b/playbooks/run_semaphore_log.j2 new file mode 100644 index 00000000..5dec07a0 --- /dev/null +++ b/playbooks/run_semaphore_log.j2 @@ -0,0 +1,2 @@ +#!/bin/sh +exec chpst -u {{ username }} svlogd -tt {{ logdir }}