mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 15:29:28 +01:00
commit
6107810ae8
14
Vagrantfile
vendored
14
Vagrantfile
vendored
@ -4,11 +4,23 @@
|
|||||||
VAGRANTFILE_API_VERSION = "2"
|
VAGRANTFILE_API_VERSION = "2"
|
||||||
|
|
||||||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
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.network :forwarded_port, guest: 3000, host: 3000
|
||||||
|
|
||||||
config.vm.provider "virtualbox" do |vb|
|
config.vm.provider "virtualbox" do |vb|
|
||||||
# vb.gui = true
|
# vb.gui = true
|
||||||
vb.customize ["modifyvm", :id, "--memory", "512"]
|
vb.customize ["modifyvm", :id, "--memory", "512"]
|
||||||
end
|
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
|
end
|
||||||
|
45
playbooks/playbook.yml
Normal file
45
playbooks/playbook.yml
Normal file
@ -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
|
||||||
|
|
||||||
|
|
4
playbooks/run_semaphore
Normal file
4
playbooks/run_semaphore
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd /opt/semaphore/
|
||||||
|
exec grunt serve
|
2
playbooks/run_semaphore_log.j2
Normal file
2
playbooks/run_semaphore_log.j2
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
exec chpst -u {{ username }} svlogd -tt {{ logdir }}
|
@ -2,7 +2,11 @@ define([
|
|||||||
'app'
|
'app'
|
||||||
], function(app) {
|
], function(app) {
|
||||||
app.config(function($stateProvider, $urlRouterProvider, $locationProvider, $couchPotatoProvider) {
|
app.config(function($stateProvider, $urlRouterProvider, $locationProvider, $couchPotatoProvider) {
|
||||||
$locationProvider.html5Mode(true);
|
$locationProvider.html5Mode({
|
||||||
|
enabled: true,
|
||||||
|
requireBase: false
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
$urlRouterProvider.otherwise('/');
|
$urlRouterProvider.otherwise('/');
|
||||||
|
|
||||||
@ -16,4 +20,4 @@ define([
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -7,7 +7,10 @@ define([
|
|||||||
'services/playbooks'
|
'services/playbooks'
|
||||||
], function(app, io) {
|
], function(app, io) {
|
||||||
app.config(function($stateProvider, $urlRouterProvider, $locationProvider, $couchPotatoProvider) {
|
app.config(function($stateProvider, $urlRouterProvider, $locationProvider, $couchPotatoProvider) {
|
||||||
$locationProvider.html5Mode(true);
|
$locationProvider.html5Mode({
|
||||||
|
enabled: true,
|
||||||
|
requireBase: false
|
||||||
|
})
|
||||||
|
|
||||||
$urlRouterProvider.otherwise('');
|
$urlRouterProvider.otherwise('');
|
||||||
|
|
||||||
@ -33,4 +36,4 @@ define([
|
|||||||
user.getUser(function() {});
|
user.getUser(function() {});
|
||||||
playbooks.getPlaybooks(function() {});
|
playbooks.getPlaybooks(function() {});
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user