@echo off @setlocal enableextensions @cd /d "%~dp0" echo " ____ ______ " echo " | _ \ /\ | ____| " echo " | |_) | / \ | |__ " echo " | _ < / /\ \ | __| " echo " | |_) / ____ \| | " echo " |____/_/ \_\_| " REM Check for admin privilages REM If not present, then exit net session >nul 2>&1 if %errorLevel% == 0 ( echo Success: Administrative permissions confirmed. ) else ( echo Failure: Current permissions inadequate. Press any key to exit the setup.. pause exit ) REM ############################################################################################################################################################ REM ############################################################################################################################################################ REM Check for virtualization REM If not present, then exit systeminfo|findstr /C:"Virtualization Enabled In Firmware:">Virtualization.txt set /P CHECK_VIRTUALIZATION=GIT_VERSION.txt docker --version>DOCKER_VERSION.txt vault --version>VAULT_VERSION.txt minikube version>MINIKUBE_VERSION.txt set /P GIT_VERSION= CHECK_USERNAME.txt set /P CHECK_USERNAME= CHECK_USEREMAIL.txt set /P CHECK_USEREMAIL= config.hcl start /min vault server -config=config.hcl echo Vault is running in other cmd (minimized, do not close it, or the vault will stop) echo Open browser at http:://localhost:8200, provide 1 and 1 in both fields and initialize echo Click Download keys or copy the keys. Then click Continue to unseal. echo Provide the unseal key first and then the root token to login. set /p VAULT_TOKEN=Enter vault token: set /p VAULT_KEY=Enter vault key: set VAULT_ADDR=http://127.0.0.1:8200 set VAULT_TOKEN=%VAULT_TOKEN% vault operator unseal %VAULT_KEY% vault secrets enable -version=1 -path=secret kv REM ############################################################################################################################################################ REM ############################################################################################################################################################ REM Setting up of minikube REM Check if Minikube is already installed or not, if already present, then this step will be skipped "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" --version set VIRTUALBOXVAR=%errorlevel% minikube status set MINIKUBEVAR=%errorlevel% if %VIRTUALBOXVAR% NEQ 9009 if %VIRTUALBOXVAR% NEQ 3 ( if %MINIKUBEVAR%==9009 ( powershell -Command "Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" choco install minikube -y )else ( echo Minikube is already installed ) )else ( echo Virtualbox is not installed. Press any key to exit the setup... pause exit ) set /p RAMSIZE=Enter ram to be used by minikube(MB): set /p CPUCOUNT=Enter cpu cores to be used by minikube: minikube config set memory %RAMSIZE% minikube config set cpus %CPUCOUNT% minikube config set kubernetes-version v1.15.4 minikube delete minikube start --vm-driver=virtualbox minikube status echo " ____ ______ " echo " | _ \ /\ | ____| " echo " | |_) | / \ | |__ " echo " | _ < / /\ \ | __| " echo " | |_) / ____ \| | " echo " |____/_/ \_\_| " PAUSE EXIT :GIT_CHECK if ["%GIT_VERSION%"]==[""] ( echo "Git not present. Git will be installed via this script" goto CHECK_DOCKER ) else ( goto GIT_FAILED ) :GIT_FAILED echo "Git version mismatched. Remove git and then run the script again." PAUSE EXIT :DOCKER_CHECK if ["%DOCKER_VERSION%"]==[""] ( echo "Docker toolbox not present. Docker toolbox will be installed via this script" goto CHECK_VAULT ) else ( goto DOCKER_FAILED ) :DOCKER_FAILED echo "Docker toolbox version mismatched. Remove docker toolbox and then run the script again." PAUSE EXIT :VAULT_CHECK if ["%VAULT_VERSION%"]==[""] ( echo "Vault cli not present. Vault cli will be installed via this script" goto CHECK_MINIKUBE ) else ( goto VAULT_FAILED ) :VAULT_FAILED echo "Vault cli version mismatched. Remove vault cli and then run the script again." PAUSE EXIT :MINIKUBE_CHECK if ["%MINIKUBE_VERSION%"]==[""] ( echo "Minikube not present. Minikube will be installed via this script" goto CONTINUE_WITH_SCRIPT ) else ( goto MINIKUBE_FAILED ) :MINIKUBE_FAILED echo "Minikube version mismatched. Remove minikube and then run the script again." PAUSE EXIT