diff options
author | Joris Roovers <jroovers@cisco.com> | 2018-03-29 23:44:44 +0200 |
---|---|---|
committer | Joris Roovers <jroovers@cisco.com> | 2018-04-06 22:15:11 +0200 |
commit | f0c4acf161a23f37c8af8985d281254822280227 (patch) | |
tree | 6065d17de9b2c4e113bb0d7539916ff0f31bfde5 /Vagrantfile | |
parent | 2a05f1b12bcc830c5d2da93d180230e1f74922dd (diff) |
Smart fallback to local repo when STDIN is a pipe or file
Gitlint will now fallback to reading from the local repository when reading an
empty input from STDIN in case STDIN is a named pipe or file.
This allows gitlint to work properly in environments where no TTY is attached
and no input is being piped into gitlint either (like when running a plain
gitlint command (no arguments) in a CI environment like Jenkins or Gitlab).
This fixes #42.
Diffstat (limited to 'Vagrantfile')
-rw-r--r-- | Vagrantfile | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Vagrantfile b/Vagrantfile index e550167..0939a09 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -19,14 +19,25 @@ grep 'cd /vagrant' /home/vagrant/.bashrc || echo 'cd /vagrant' >> /home/vagrant/ grep 'source .venv27/bin/activate' /home/vagrant/.bashrc || echo 'source .venv27/bin/activate' >> /home/vagrant/.bashrc EOF +INSTALL_JENKINS=<<EOF +wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add - +sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list' +sudo apt-get update +sudo apt-get install -y jenkins +EOF + Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "ubuntu/xenial64" config.vm.define "dev" do |dev| - dev.vm.provision "shell", inline: "#{INSTALL_DEPS}" + dev.vm.provision "gitlint", type: "shell", inline: "#{INSTALL_DEPS}" + # Use 'vagrant provision --provision-with jenkins' to only run jenkins install + dev.vm.provision "jenkins", type: "shell", inline: "#{INSTALL_JENKINS}" end + config.vm.network "forwarded_port", guest: 8080, host: 9080 + if Vagrant.has_plugin?("vagrant-cachier") config.cache.scope = :box end |