Most of the Windows setup is now documented on Github here https://github.com/Health-Education-England/dev-handbook/blob/master/environment-setup/common.md
BUT before doing the above you should first do the following:
Install chocolatey (windows package manager)
- Downloading it from this link (https://chocolatey.org/install) and completing the installation steps
- Run a PowerShell terminal as an administrator and type in the following commands
- Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
- iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
- Check the installed version of chocolatey on your machine by using the command - > chocolatey -v
- If you encounter any issues while installing any of the following packages, disable your windows antivirus
Install windows packages via chocolatey
- You can install individual packages via the cmd line like so: choco install <name of package> -y
- But another way is to create an xml file containing all the packages you want to install:
- create a file e.g. tis-dev-packages.config which looks something like this:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="7zip"/>
<package id="openjdk11"/>
<package id="jdk8"/>
<package id="nodejs-lts"/>
<package id="maven"/>
<package id="gradle"/>
<package id="git"/>
<package id="docker-desktop"/>
<package id="notepadplusplus"/>
<package id="intellijidea-community"/>
<package id="vscode"/>
<package id="postman"/>
<package id="dbeaver"/>
<package id="microsoft-teams"/>
<package id="slack"/>
<package id="mousewithoutborders"/>
<package id="mysql.workbench"/>
<package id="awscli"/>
</packages>
- Then in the cmd line: choco install <file_path to the above file>/tis-dev-packages.config -y
Set your windows hosts file
- Find your 'hosts' file by navigating to the following location - > C:\Windows\System32\drivers\etc\hosts
Add local.tis.com to the following line
Code Block |
---|
127.0.0.1 localhost local.tis.com |
You may need to run notepad as administrator and open the file from within there to be able to save it.
Generate SSH keys
- Generate a new ssh key with the following cmd (I use Git Bash terminal):
ssh-keygen -t rsa -b 4096 -C "joebloggs.com" (replace joebloggs with your email address but keep the quotation marks)
- When you are prompted to "Enter a file in which to save the key" press Enter (this accepts the default location)
- When prompted to enter a passphrase you can either enter a passphrase or leave blank by just hitting enter (if you opt for a passphrase then you need to enter it every time you e.g. push to github)
This should generate a key which starts with ssh-rsa .................... and ends with == joebloggs.com .
- Check in this file to make sure the above key has been generated C:\Users\<Your name>\.ssh\id_rsa.pub (you may need to use "open with" e.g. notepad because it defaults to a Publisher file!)
- Add the key to github keys https://github.com/settings/keys
Here's some more detailed notes on ssh key pair generation:
Generate a public/private ssh key pair (https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/) and provide the public key to the git admin within the team. Add the public key to your git account https://github.com/settings/keys
Now follow the guide on the /wiki/spaces/TISDEV/pages/31981641 page.
If there are issues with SSH, you can set up your repos to use https instead https://help.github.com/articles/changing-a-remote-s-url/
Implications of line endings settings on windows development environment
Programming on Windows alongside developers who are not (or vice-versa), will usually result in line-ending issues at some point. This is because Windows uses both a carriage-return character and a linefeed character for newlines in its files, whereas Mac and Linux systems use only the linefeed character. Because the team predominantly consists of MAC users, to ensure that the line-ending issue doesn't occur, apply a one off fix by typing in the following command
git config --global core.autocrlf input
This fix will leave you with CRLF endings in Windows checkouts, but LF endings on Mac and Linux systems and in the repository.