slashrelativepath / relativepath-cycle-5

Source repository for Relative Path Cycle 5
3 stars 0 forks source link

Powershell/Windows webserver-script #8

Closed eld120 closed 10 months ago

eld120 commented 10 months ago

As a number of users are developing on Windows/Powershell we need a powershell script to check/install our dependencies

eld120 commented 10 months ago

I initially wanted to create a start script to check the host OS and run the appropriate webserver script based on the OS + distro. I still like this approach but it's a bit of a leap for me at this time. I welcome ideas on how to approach this from other contributors.

eld120 commented 10 months ago

Update - writing this for powershell 5.1+ as I apparently do not have powershell 6/7+ installed locally.

ChrisForti commented 10 months ago

we should go straight for the pkg manager, which is chocolatey for powershell. I can start a script for PS, and include the command to install choco. Push it to the repo, if you want to pull down and test. it will just be for the pkg manager, which from there we can add nano, git, multipass etc.

ChrisForti commented 10 months ago

It is there if want to pull it down and test it.

eld120 commented 10 months ago

reopening this issue and linking my PR. Honestly my PR should be renamed and is more broad that this single issue but chocolatey and winget are both package managers and we could use either one. My initial hesitation to use winget is that we started this project with chocolatey and there's an existing ecosystem for that tool. I've heard good things for winget but my intent is to choose a tool and move forward with it regardless of which tool that may be, at the time that tool was chocolatey.

webserver-windows.ps1 has conditional logic to test for chocolatey, git, nano, virtualbox and multipass and installs each if they are not present. I'm working on testing whether or not a multipass instance exists on the server (multipass info --all displays any/all instances of started/stopped/deleted VMs on the machine, as a note deleted VMs can be restored apparently).

High level idea (Epic) that I tried but didn't work: create a start script that would determine the host OS and then choose the appropriate webserver script to take over the dependency installation and subsequent web server installation/setup. These are distinct steps to me as the host OS is a potential unknown, our VM has dependencies that will vary based on the host OS and whatever might need to be installed, then we can fit a fairly standard VM setup script from there. This is an implementation for the epic that we discussed today but I don't know if it's the right approach.