forked from ddterm/gnome-shell-extension-ddterm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
130 lines (104 loc) · 3.53 KB
/
Vagrantfile
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# -*- mode: ruby -*-
# vi: set ft=ruby :
# See docs/Vagrant.md
require 'open3'
require 'pathname'
CPUS = 4
MEMORY = 2048
PROJECT_DIR = Pathname.new(__FILE__).realpath.dirname
SYNCED_FOLDER = "/home/vagrant/#{PROJECT_DIR.basename}"
UUID = '[email protected]'
PACK_FILE_FALLBACK = Pathname.getwd / "#{UUID}.shell-extension.zip"
PACK_FILE_FALLBACK_LEGACY = Pathname.getwd / "#{UUID}.legacy.shell-extension.zip"
if not PACK_FILE_FALLBACK.exist? and PACK_FILE_FALLBACK_LEGACY.exist?
PACK_FILE_FALLBACK = PACK_FILE_FALLBACK_LEGACY
end
PACK_FILE = Pathname.getwd / ENV.fetch('DDTERM_BUILT_PACK', PACK_FILE_FALLBACK.to_s)
stdout, status = Open3.capture2(
'git',
'ls-files',
'--exclude-standard',
'-oi',
'--deduplicate',
'--directory',
'--no-empty-directory',
'--full-name',
':/'
)
if status.success?
rsync_excludes = stdout.split(/\n/).map { |p| "/#{p}" }
else
rsync_excludes = []
end
rsync_args = [
'-avcS',
'--exclude-from=.gitignore',
'--exclude-from=test/.gitignore',
'--exclude-from=tools/.gitignore',
]
Vagrant.configure("2") do |config|
config.vagrant.plugins = 'vagrant-libvirt'
config.vm.provider 'libvirt' do |libvirt, override|
libvirt.qemu_use_session = true
libvirt.cpus = CPUS
libvirt.memory = MEMORY
libvirt.cputopology :sockets => '1', :cores => "#{CPUS}", :threads => '1'
end
config.vm.synced_folder '.', '/vagrant', disabled: true
config.vm.synced_folder '.', SYNCED_FOLDER,
type: 'rsync',
rsync__exclude: rsync_excludes,
rsync__args: rsync_args
config.vm.provision 'copy',
type: 'file',
source: PACK_FILE,
destination: "$HOME/#{PACK_FILE.basename}",
before: 'install',
run: 'always'
config.vm.provision 'install', type: 'shell', privileged: false, run: 'always', inline: <<-SCRIPT
gnome-extensions install -f $HOME/#{PACK_FILE.basename}
gnome-extensions enable #{UUID}
SCRIPT
config.vm.provision 'reload', type: 'shell', run: 'always', after: 'install', inline: <<-SCRIPT
loginctl terminate-user vagrant
SCRIPT
config.vm.define "fedora39", primary: true do |version|
version.vm.box = "mezinalexander/fedora39"
end
config.vm.define "ubuntu2310", autostart: false do |version|
version.vm.box = "mezinalexander/ubuntu2310"
end
config.vm.define "silverblue39", autostart: false do |version|
version.vm.box = "mezinalexander/silverblue39"
end
config.vm.define "opensusetumbleweed", autostart: false do |version|
version.vm.box = "mezinalexander/opensusetumbleweed"
end
config.vm.define "opensuseleap155", autostart: false do |version|
version.vm.box = "mezinalexander/opensuseleap155"
end
config.vm.define "centos9s", autostart: false do |version|
version.vm.box = "mezinalexander/centos9s"
end
config.vm.define "debian12", autostart: false do |version|
version.vm.box = "mezinalexander/debian12"
end
config.vm.define "alpine319", autostart: false do |version|
version.vm.box = "mezinalexander/alpine319"
version.ssh.sudo_command = "doas -n -u root %c"
version.vm.synced_folder '.', SYNCED_FOLDER,
type: 'rsync',
rsync__exclude: rsync_excludes,
rsync__rsync_path: 'doas -u root rsync',
rsync__args: rsync_args
end
config.vm.define "alpine318", autostart: false do |version|
version.vm.box = "mezinalexander/alpine318"
version.ssh.sudo_command = "doas -n -u root %c"
version.vm.synced_folder '.', SYNCED_FOLDER,
type: 'rsync',
rsync__exclude: rsync_excludes,
rsync__rsync_path: 'doas -u root rsync',
rsync__args: rsync_args
end
end