π§Setup WSL2 Environment for Windows
Pre-requisite
OS: Windows 11
graphics cards installer compatible on your device
Steps
wsl --installInstall Ubuntu 20.04 LTS from Microsoft store
Note: This will be the default terminal that we will be using so make sure all the commands are run under Ubuntu terminal
Set SSH key
ssh-keygen -t ed25519 -C "your_email@example.com"1. When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location. 2. At the prompt, type a secure passphrase. go to the file directory where the ssh key is saved/c/Users/you/.ssh/id_algorithmGo to your Github settings > SSH Key & GPG Keys then Paste the generated key under .ssh folderInstall Remote-wsl on your VSCode extension
run this command
sudo apt update && sudo apt dist-upgradeClone Project repository using SSH
On your root folder run this command
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose^^Install Docker inside wsl
Install AWS CLI
Configure aws
aws configure --profile identifi_qaaccess key: AKIAR73M5IQAJDI7TGPN secret key: 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 region: ap-southeast-1 output: jsonRun aws login
aws ecr get-login-password --region ap-southeast-1 | docker login --username AWS --password-stdin 137130492928.dkr.ecr.ap-southeast-1.amazonaws.comrun the following on your terminal Note: If you may encounter some unknown commands all you have to to is install it
sudo usermod -aG docker ${USER}sudo apt-get update -ycurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -sudo apt-key fingerprint 0EBFCD88sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"sudo apt-get update -ysudo apt-get install -y docker-cesudo e2fsck /dev/sdb -ysudo e2fsck /dev/sdb -pwsl --shutdownwsl.exe -l -vwsl --set-default ubuntuls -lad /tmpsudo usermod -aG docker $USERaws ecr get-login-password --region ap-southeast-1 | docker login --username AWS --password-stdin 137130492928.dkr.ecr.ap-southeast-1.amazonaws.comsudo groupadd dockersudo usermod -aG docker ${USER}su -s ${USER}docker run hello-worldaws ecr get-login-password --region ap-southeast-1 | docker login --username AWS --password-stdin 137130492928.dkr.ecr.ap-southeast-1.amazonaws.comsudo docker-compose up -dOpen the test folder directory of the project and install the following packages
npm installsudo apt install libgtk-3-0sudo apt-get install libatk1.0-0sudo apt-get install -y libgbm-devsudo apt install xvfbsudo apt-get install curlcurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bashcommand -v nvmInstall required node version use in the project then check node and npm version
node -vnpm --versionRun Docker command
docker-compose down: to stop running the containersdocker-compose pull: to pull the latest docker image of the projectdocker-compose up -d: to start and run the applicationdocker container ls: to verify if the docker container is runningCheck if you run able to run the test by running
npx cypress openVisit on your browser the project application: localhost:9000/login
Last updated