Skip to content
This repository was archived by the owner on Dec 3, 2021. It is now read-only.

Commit 4542751

Browse files
committed
Add support for Windows through batch file anti-up.bat. This requires cygwin or the Windows 10 OpenSSH client.
1 parent 65bdb1e commit 4542751

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

anti-up.bat

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
@echo off
2+
setlocal enabledelayedexpansion enableextensions
3+
4+
ECHO Welcome to antidote-selfmedicate. Take the red pill, it's more fun!
5+
6+
where /q scp
7+
IF ERRORLEVEL 1 (
8+
ECHO Cygwin not found. Please install Cygwin or enable ssh/scp on Windows 10.
9+
EXIT /B
10+
)
11+
12+
where /q minikube
13+
IF ERRORLEVEL 1 (
14+
ECHO Minikube not found. Please follow installation instructions at: https://antidoteproject.readthedocs.io/en/latest/building/buildlocal.html
15+
EXIT /B
16+
) ELSE (
17+
ECHO WARNING, this will delete any existing minikube cluster.
18+
PAUSE
19+
)
20+
21+
22+
23+
IF NOT exist %USERPROFILE%/.kube/premselfmedicate_bkp (
24+
ECHO Backing up existing kubeconfig to %USERPROFILE%/.kube/preminikube_bkp...
25+
cp %USERPROFILE%/.kube/config %USERPROFILE%/.kube/premselfmedicate_bkp
26+
) ELSE (
27+
ECHO Existing kubeconfig backup found, not re-copying.
28+
)
29+
30+
ECHO Creating minikube cluster. This can take a few minutes, please be patient...
31+
minikube stop >nul 2>&1
32+
minikube delete >nul 2>&1
33+
minikube start --cpus 4 --memory 8192 --network-plugin=cni --extra-config=kubelet.network-plugin=cni >nul 2>&1
34+
35+
:: Set environment variables
36+
FOR /F "tokens=* USEBACKQ" %%F IN (`minikube ip`) DO (
37+
SET minikube_ip=%%F
38+
)
39+
REM ECHO %minikube_ip%
40+
41+
FOR /F "tokens=* USEBACKQ" %%F IN (`minikube ssh-key`) DO (
42+
SET minikube_ssh-key=%%F
43+
)
44+
REM ECHO %minikube_ssh-key%
45+
46+
scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i %minikube_ssh-key% multus-cni.conf docker@%minikube_ip%:/home/docker/multus.conf >nul 2>&1
47+
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i %minikube_ssh-key% -t docker@%minikube_ip% "sudo cp /home/docker/multus.conf /etc/cni/net.d/1-multus.conf" >nul 2>&1
48+
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i %minikube_ssh-key% -t docker@%minikube_ip% "sudo systemctl restart localkube" >nul 2>&1
49+
50+
ECHO About to modify %WINDIR%\system32\drivers\etc\hosts to add record for 'antidote-local'.
51+
SET NEWLINE=^& echo.
52+
FIND /C /I "antidote-local" %WINDIR%\system32\drivers\etc\hosts
53+
IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^%minikube_ip% antidote-local>>%WINDIR%\System32\drivers\etc\hosts
54+
55+
echo "Uploading platform manifests..."
56+
kubectl create -f weaveinstall.yml >nul 2>&1
57+
kubectl create -f multusinstall.yml >nul 2>&1
58+
kubectl create -f nginx-controller.yaml >nul 2>&1
59+
kubectl create -f syringe.yml >nul 2>&1
60+
kubectl create -f antidote-web.yaml >nul 2>&1
61+
62+
ECHO "Finished! Antidote is being spun up right now. Soon, it will be available at:"
63+
ECHO https://antidote-local:30002/
64+
EXIT /B
65+

0 commit comments

Comments
 (0)