]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
make it easier to run the dev server
authorDylan William Hardison <dylan@hardison.net>
Wed, 23 Jan 2019 19:25:50 +0000 (14:25 -0500)
committerGitHub <noreply@github.com>
Wed, 23 Jan 2019 19:25:50 +0000 (14:25 -0500)
Vagrantfile
vagrant_support/bashrc
vagrant_support/devtools.yml
vagrant_support/hypnotoad.yml
vagrant_support/start_morbo [new file with mode: 0644]

index f63c707a0907bd4b300d678ab97d5de6d8f762a8..863371276e4ad57dbb8b2a4914299eb8fb25efdd 100644 (file)
@@ -17,7 +17,6 @@ VENDOR_BUNDLE_URL = ENV.fetch "BMO_BUNDLE_URL",
 RSYNC_ARGS = [
   '--verbose',
   '--archive',
-  '--delete',
   '-z',
   '--copy-links',
   '--exclude=local/',
@@ -28,6 +27,26 @@ RSYNC_ARGS = [
   '--include=.git/'
 ]
 
+# This is a little weird, but we need to update
+require 'json'
+
+Dir.glob(".vagrant/machines/*/*/synced_folders").each do |filename|
+  synced_folders = JSON.parse(IO.read(filename))
+  synced_folder = synced_folders["rsync"]["/vagrant"]
+  dirty = false
+  %w( rsync__args args ).each do |key|
+    if RSYNC_ARGS != synced_folder[key]
+      dirty = true
+      synced_folder[key] = RSYNC_ARGS
+    end
+    if dirty
+      say "Updating #{filename} because it has old rsync args"
+      IO.write(filename + ".new", JSON.unparse(synced_folders))
+    end
+  end
+end
+
+
 # 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
index d4dba9f40d4d38cd94a07904d0c1db47e8a46968..72290966aa672ec43e311ccb8ac99eaf7da39f00 100644 (file)
@@ -10,5 +10,6 @@ PS1='\[\e[0;31m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] $ '
 
 export PERL5LIB=/vagrant/local/lib/perl5
 export PATH=/vagrant/local/bin:$PATH
+export MOJO_LISTEN="http://*:80"
 
 cd /vagrant
index 3d4c9dbcdec789a5612329c5f56b81e835a61d8a..e44a00dd7f5414eb7d927c28ab6cb86dbb004828 100644 (file)
@@ -18,6 +18,9 @@
 - name: copy re.pl
   copy: src=re.pl dest=/usr/local/bin/re.pl mode=0755
 
+- name: copy start_morbo
+  copy: src=start_morbo dest=/usr/local/bin/start_morbo mode=0755
+
 - name: copy use-nytprof
   copy: src=use-nytprof dest=/usr/local/bin/use-nytprof mode=0755
 
index a66f9ba0471799e0fc86ca69e33a3e6ec07744f8..ebfd2773792041e1a3054d8df0097882768bec18 100644 (file)
     group: root
     mode: 0755
 
-- name: enable hypnotoad
-  service: name=hypnotoad enabled=yes
+- name: disable hypnotoad
+  service: name=hypnotoad enabled=no
   when: LAZY == 0
 
-- name: restart hypnotoad
-  service: name=hypnotoad state=restarted
+- name: stop hypnotoad
+  service: name=hypnotoad state=stopped
 
diff --git a/vagrant_support/start_morbo b/vagrant_support/start_morbo
new file mode 100644 (file)
index 0000000..926655b
--- /dev/null
@@ -0,0 +1,10 @@
+#!/usr/bin/env perl
+
+$ENV{PERL5LIB}    = '/vagrant/local/lib/perl5';
+$ENV{PATH}        = "/vagrant/local/bin:$ENV{PATH}";
+$ENV{MOJO_LISTEN} = 'http://*:80';
+
+my @files = ('Bugzilla.pm', 'Bugzilla', glob("*.cgi"), 'extensions', 'template');
+my @watch=  map { ('-w' => $_) } (@files);
+
+system morbo => @watch, '-v', 'bugzilla.pl';