clever_vm: Add scripts to install ROS and VSCode

This commit is contained in:
Alexey Rogachevskiy
2020-02-24 02:21:05 +03:00
parent b99ec328bb
commit e881a441f6
5 changed files with 81 additions and 0 deletions

50
ros_ide_vm.json Normal file
View File

@@ -0,0 +1,50 @@
{
"variables": {
"user": "clever",
"password": "clever",
"vm-name": "clever-devel",
"scriptsDir": "scripts"
},
"builders": [{
"type": "virtualbox-ovf",
"vm_name": "{{user `vm-name`}}",
"source_path": "output-virtualbox-iso/{{user `vm-name`}}.ova",
"format": "ova",
"vboxmanage": [
["modifyvm", "{{.Name}}", "--memory", "4096", "--vram", "128", "--mouse", "usbtablet", "--rtcuseutc", "on", "--usb", "on", "--usbxhci", "on"],
["storageattach", "{{.Name}}", "--storagectl", "SATA Controller", "--port", "0", "--nonrotational", "on", "--discard", "on"]
],
"import_opts": "importtovdi",
"ssh_username": "{{user `user`}}",
"ssh_password": "{{user `password`}}",
"ssh_wait_timeout": "10000s",
"boot_wait": "30s",
"virtualbox_version_file": ".vbox_version",
"shutdown_command": "echo '{{user `password`}}' | sudo -S shutdown -P now"
}],
"provisioners": [{
"type": "shell",
"script": "scripts/installGuestAdditions.sh",
"execute_command": "echo '{{user `password`}}' | {{.Vars}} sudo -E -S sh '{{.Path}}'"
},
{
"type": "shell",
"script": "scripts/installRos.sh",
"execute_command": "echo '{{user `password`}}' | {{.Vars}} sudo -E -S sh '{{.Path}}'"
},
{
"type": "shell",
"script": "scripts/installVsCode.sh",
"execute_command": "echo '{{user `password`}}' | {{.Vars}} sudo -E -S sh '{{.Path}}'"
},
{
"type": "shell",
"script": "scripts/installRosUser.sh"
}
]
}

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
sudo apt update
sudo apt install -y build-essential make perl
sudo mount -o loop,ro /home/clever/VBoxGuestAdditions.iso /mnt
sudo /mnt/VBoxLinuxAdditions.run
sudo umount /mnt

9
scripts/installRos.sh Normal file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt update
sudo apt install -y python-rosinstall python-rosinstall-generator python-wstool build-essential
sudo apt install -y ros-melodic-desktop
sudo rosdep init

View File

@@ -0,0 +1,4 @@
#!/usr/bin/env bash
rosdep update
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc

11
scripts/installVsCode.sh Normal file
View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
sudo apt update
sudo apt install -y curl
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /usr/share/keyrings/
sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt-get install -y apt-transport-https
sudo apt-get update
sudo apt-get install -y code