Box UI Elements test codes

Codes for testing UI Elements on localhost (or Docker)

Getting started

Using Node.js

Run the following command:

npm install     <- first time ONLY
npm run start

To access the page,

Using Docker

Run the following command (containers are built and launched based on docker-compose.yaml):

docker-compose up

To access the page,

where 192.168.99.100 is the IP address of docker VM (can be looked up by running docker-machine ip)

Using Kubernetes

To initiate services and deployments inside k8s folder, run the below command:

kubectl apply -f k8s

To access the page,

where 192.168.99.101 is the IP address of minikube (can be looked up by running minikube ip)

To get the list of pods, run this:

kubectl get pods

Output:

NAME                                  READY   STATUS    RESTARTS   AGE
express-deployment-5989b69bf7-gj47s   1/1     Running   0          60s
express-deployment-5989b69bf7-t455w   1/1     Running   0          69s
express-deployment-5989b69bf7-vhcrd   1/1     Running   0          65s

To get the log of a specific pod, run this:

kubectl logs express-deployment-5989b69bf7-gj47s

Output:

> ui_elements@1.0.0 start /app
> nodemon index.js

 [33m[nodemon] 2.0.4 [39m
 [33m[nodemon] to restart at any time, enter `rs` [39m
 [33m[nodemon] watching path(s): *.* [39m
 [33m[nodemon] watching extensions: js,mjs,json [39m
 [32m[nodemon] starting `node index.js` [39m

To clean up k8s services/deployments, run this:

kubectl delete -f k8s

To update docker image, run this:

docker build -t lyugaloki/ui-elements-express -f ./Dockerfile.dev .
docker push lyugaloki/ui-elements-express