瀏覽代碼

Give the testing VM commands and help text

Benjamin Sago 8 年之前
父節點
當前提交
eb1188c2c8
共有 2 個文件被更改,包括 31 次插入0 次删除
  1. 19 0
      Vagrantfile
  2. 12 0
      devtools/dev-help-testvm.sh

+ 19 - 0
Vagrantfile

@@ -574,5 +574,24 @@ Vagrant.configure(2) do |config|
       set -xe
       apt-get install -qq -o=Dpkg::Use-Pty=0 -y unzip
     EOF
+
+    # This thing also has its own welcoming text.
+    config.vm.provision :shell, privileged: true, inline: <<-EOF
+      rm -f /etc/update-motd.d/*
+
+      # Capture the help text so it gets displayed first
+      bash /vagrant/devtools/dev-help-testvm.sh > /etc/motd
+
+      # Disable last login date in sshd
+      sed -i '/PrintLastLog yes/c\PrintLastLog no' /etc/ssh/sshd_config
+      systemctl restart sshd
+    EOF
+
+    # Make the checker script a command.
+    config.vm.provision :shell, privileged: true, inline: <<-EOF
+      set -xe
+      echo -e "#!/bin/sh\nbash /vagrant/devtools/dev-download-and-check-release.sh \"\\$*\"" > /usr/bin/check-release
+      chmod +x /usr/bin/check-release
+    EOF
   end
 end

+ 12 - 0
devtools/dev-help-testvm.sh

@@ -0,0 +1,12 @@
+# This file is like the other one, except for the testing VM.
+# It also gets dumped into /etc/motd.
+
+
+echo -e "
+\033[1;33mThe exa testing environment!\033[0m
+This machine is dependency-free, and can be used to test that
+released versions of exa still work on vanilla Linux installs.
+
+\033[4mCommands\033[0m
+\033[32;1mcheck-release\033[0m to download and verify released binaries
+"