-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathVagrantfile
More file actions
55 lines (46 loc) · 2.01 KB
/
Vagrantfile
File metadata and controls
55 lines (46 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# ubuntu 14.04 64bit image
config.vm.box = "ubuntu/trusty64"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
config.vm.provider "virtualbox" do |vb|
vb.name = "Tested Transcoder"
vb.memory = ENV["VM_MEMORY"] || 4096
vb.cpus = ENV["VM_CPUS"] || 4
end
# bootstrap the ubuntu machine
config.vm.provision "shell", inline: <<-SHELL
add-apt-repository -y ppa:stebbins/handbrake-releases
add-apt-repository -y ppa:mc3man/trusty-media
apt-get update
apt-get install -y make git mkvtoolnix handbrake-cli mplayer ffmpeg mp4v2-utils linux-headers-generic build-essential dkms virtualbox-guest-utils virtualbox-guest-dkms supervisor
git clone https://github.com/donmelton/video-transcoding-scripts
mv video-transcoding-scripts/*.sh /usr/local/bin/
rm -rf video-transcoding-scripts
# transcoder root. this is where the transcoder directory will be mounted
mkdir -p /media/transcoder
# install the transcoder's supervisor config file and reload supervisor
cp /vagrant/supervisor-config.conf /etc/supervisor/conf.d/transcoder.conf
cp /vagrant/transcoder.py /usr/local/bin
chmod +x /usr/local/bin/transcoder.py
supervisorctl reload
SHELL
# copy the transcoder.py script in to place. always run this provisioner to
# get the most recent copy of the script.
config.vm.provision "shell", run: "always", inline: <<-SHELL
cp /vagrant/transcoder.py /usr/local/bin
chmod +x /usr/local/bin/transcoder.py
supervisorctl reload
SHELL
if ENV["TRANSCODER_ROOT"]
config.vm.synced_folder ENV["TRANSCODER_ROOT"], "/media/transcoder"
end
end