Giter VIP home page Giter VIP logo

country-phone's Introduction

country-phone

Build Status Sonarcloud Status

https://country-phone.herokuapp.com/

Tests

Running tests locally

Unit Tests

./gradlew clean test

Integration Tests

./gradlew clean intTest

Unit, Int tests and Code Coverage report

./gradlew clean build jacocoTestReport

Building and running application

./gradlew build && java -jar build/libs/country-phone-0.0.1-SNAPSHOT.jar

Docker

Building Docker Image

./gradlew clean build && docker build -t country-phone .

Build jar first and create an image out of it

Running Docker Image

docker run -e "SPRING_PROFILES=local" -p 8080:8080 country-phone

specify -d in order to run in detached mode

Building and Running via Docker Compose

docker-compose up

Pushing images to DockerHub

  1. Login with your Docker Id docker login, create a Docker Hub repo with the same title
  2. Tag the image (To push a local image to docker registry, you need to associate the local image with a repository on the docker registry. The notation for the repository on docker registry is username/repository:tag)

Need to push 2 times - with the tag and tag = latest

docker tag country-phone ilja07/country-phone:0.0.1-SNAPSHOT
docker tag country-phone ilja07/country-phone:latest
  1. Push the image to docker hub
docker push ilja07/country-phone:0.0.1-SNAPSHOT
docker push ilja07/country-phone:latest

Kubernetes

minikube start
kubectl create deployment country-phone --image=ilja07/country-phone

OR

kubectl create -f k8s/manifest.yml 

OR

kubectl apply -f k8s/manifest.yml 

create vs apply -> https://stackoverflow.com/questions/47369351/kubectl-apply-vs-kubectl-create

Verify status of pods

kubectl get pods

Get all Kubernetes resources info - shows all pods, replicasets, deployments, services, etc

kubectl get all

If POD is running, then open app locally

  1. find out cluster's ip
minikube ip

OR

minikube service country-phone-service --url
  1. open app
http://<minikube_ip>:30001/

In case when you need to update some thing

  1. change the specification file
  2. apply the changes to Kubernetes master
kubectl apply -f k8s/manifest.yml

Connect to Pod and Container

In this case, our Pod has a single container, so we don't need to specify one

kubectl exec pod1 -it -- env | grep ENVVAR

Troubleshooting

kubectl logs <POD_NAME>
kubectl describe pods <POD_NAME>

Performance testing

docker run -it --rm -v  /<fullpath>/performancetesting/configs:/bzt-configs -v/ /<fullpath>/performancetesting/artifacts:/tmp/artifacts blazemeter/taurus config.yaml

OR just install Taurus locally - https://gettaurus.org/docs/Installation/

brew install bzt

country-phone's People

Contributors

iljapavlovs avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.