Change user in Vagrantfile

Why I have to keep doing this I have no idea. If you know, please tell!
This commit is contained in:
Benjamin Sago 2018-09-26 21:25:50 +01:00
parent 94a00fa17c
commit 70606f95ff
3 changed files with 11 additions and 10 deletions

17
Vagrantfile vendored
View File

@ -21,7 +21,7 @@ Vagrant.configure(2) do |config|
# Make sure we know the VM images default user name. The cassowary user
# (specified later) is used for most of the test *output*, but we still
# need to know where the target and .cargo directories go.
developer = 'ubuntu'
developer = 'vagrant'
# Install the dependencies needed for exa to build, as quietly as
@ -92,15 +92,15 @@ Vagrant.configure(2) do |config|
config.vm.provision :shell, privileged: false, inline: <<-EOF
set -xe
if [ -d /home/ubuntu/git2-rs ]; then
cd /home/ubuntu/git2-rs
if [ -d /home/#{developer}/git2-rs ]; then
cd /home/#{developer}/git2-rs
git pull https://github.com/ogham/git2-rs.git || echo "Failed to update git2-rs fork"
else
git clone https://github.com/ogham/git2-rs.git /home/ubuntu/git2-rs
git clone https://github.com/ogham/git2-rs.git /home/#{developer}/git2-rs
fi
mkdir -p /home/ubuntu/.cargo
echo 'paths = ["/home/ubuntu/git2-rs/libgit2-sys"]' > /home/ubuntu/.cargo/config
mkdir -p /home/#{developer}/.cargo
echo 'paths = ["/home/#{developer}/git2-rs/libgit2-sys"]' > /home/#{developer}/.cargo/config
EOF
# This fix is applied by changing the VM rather than changing the
@ -119,7 +119,7 @@ Vagrant.configure(2) do |config|
bash /vagrant/devtools/dev-help.sh > /etc/motd
# Tell bash to execute a bunch of stuff when a session starts
echo "source /vagrant/devtools/dev-bash.sh" > /home/ubuntu/.bash_profile
echo "source /vagrant/devtools/dev-bash.sh" > /home/#{developer}/.bash_profile
# Disable last login date in sshd
sed -i '/PrintLastLog yes/c\PrintLastLog no' /etc/ssh/sshd_config
@ -443,9 +443,10 @@ Vagrant.configure(2) do |config|
echo "this file gets moved" > moves/hither
git add edits moves
git config --global user.email "exa@exa.exa"
git config --global user.name "Exa Exa"
git commit -m "Automated test commit"
echo "modifications!" | tee edits/{staged,both}
touch additions/{staged,edited}
mv moves/{hither,thither}

View File

@ -6,7 +6,7 @@
echo -e "
\033[1;33mThe exa development environment!\033[0m
exa's source is available at \033[33m/vagrant\033[0m.
Binaries get built into \033[33m/home/ubuntu/target\033[0m.
Binaries get built into \033[33m/home/vagrant/target\033[0m.
\033[4mCommands\033[0m
\033[32;1mexa\033[0m to run the built version of exa

View File

@ -45,7 +45,7 @@ rm -vf "$exa_linux_binary"
cargo build --release --manifest-path "$toml_file"
cargo test --release --manifest-path "$toml_file" --lib -- --quiet
/vagrant/xtests/run.sh --release
cp /home/ubuntu/target/release/exa "$exa_linux_binary"
cp /home/vagrant/target/release/exa "$exa_linux_binary"
# Stripping the binary before distributing it removes a bunch of debugging
# symbols, saving some space.