-
Notifications
You must be signed in to change notification settings - Fork 25
Updating Software Installed on a Virtual Machine
Most often it's faster and easier to log into host machines one by one to update installed software than following the instructions outlined in Copying a Virtual Machine.
When updating the software installed on a virtual machine, we will need to stop the runners. Therefore we should take care not to update all virtual machines at once in order to ensure that we have at least one runner operating so developers can continue relying on the CI/CD infrastructure. Generally speaking, we can update all runners but one at once and update the remaining one when all others are back up.
Assuming we have the three host machines HM1, HM2, and HM3, we can update the installed software using the following workflow:
- Log into HM1 and HM2 using macOS' built-in Screen Sharing app.
- Stop the runners by selecting "Stop" in Tartelet on both HM1 and HM2.
- Edit the virtual machine on both HM1 and HM2 by selecting "Edit Virtual Machine" in Tartelet.
- Make the needed changes in the virtual machines on both HM1 and HM2.
- Shutdown the virtual machines on HM1 and HM2.
- Start the runners on HM1 and HM2 by selecting "Start" in Tartelet. The virtual machines on HM1 and HM2 have now been updated and are running again.
- Perform the same steps for HM3.
The sections below contain detailed instructions on updating specific software.
Any software installed with Homebrew can be updated by editing a virtual machine and running the following two commands.
brew update
brew upgrade
It is recommended to rely on xcodes to manage Xcode versions installed on the virtual machines.
A new version of Xcode can be installed by editing a virtual machine and performing the following steps.
- Open the Terminal.
- If needed, uninstall an existing version of Xcode by running
xcodes uninstall
and supplying a version number, e.g.xcodes uninstall "15.0 Beta 7"
. - Install the new version of Xcode by running
xcodes install
and supplying a version number, e.g.xcodes install "15.0 Beta 8"
. - During the installation, you may be prompted to authenticate with two-factor authentication. Select your phone number when prompted and enter the corresponding two-factor authentication code. At Shape we use a phone number that forwards incoming messages in Slack to ensure that the account logged into a virtual machine is not tied to a specific employee.
- Launch Xcode to install any relevant runtimes and remove any unneeded runtimes.
Update node by editing a virtual machine and performing the following steps.
- Install the new version of node by running
nvm install
and supplying a version number, e.g.nvm install 18.17.1
. - Make sure the new version is in use by running
nvm use
and supplying a version number, e.g.nvm use 18.17.1
. - If needed, uninstall the old version by running
nvm uninstall
and supplying a version number, e.g.nvm uninstall 17.9.0
.
Tartelet is built with ❤️ by Shape in Denmark. Oh, and we are hiring 🤗