Skip to content

iTechArt Golang Students Lab Social tournament service

License

Notifications You must be signed in to change notification settings

PlagaMedicum/tournament

Repository files navigation

Social tournament service

CircleCI codecov Go Report Card License

This is a RESTful web server with a social tournament service implementation.
Created within the ITechArt Golang Students Lab.

Deployment

If you want to deploy this application both locally or in GCloud, you need to run the ./deploy.sh script with flags.
See ./deploy.sh --help for more information.

To deploy project in GCloud follow these steps:
First of all you will need to set the PROJECT_ID variable. Check this for more information.
Then you need to run following command in your terminal:

export PROJECT_ID=PASTE_YOUR_PROJECT_ID_HERE

After this you'll need to create google_credentials.json file. Check this for more information.

Finally, following command will build all of project's images and create a cluster with deployment:

./deploy.sh up

This will take some time, so you can spend it making a cup of hot tea/coffee (choose one).

If everything ready, you can try to access the server. To get the external ip of server run:

kubectl describe service server

and copy the value of LoadBalancer Ingres: .

Then you can try to test some endpoints:

  • Create user:
POST http://PASTE_SERVICE_IP_HERE/user
BODY:

{
    "name": "Daniil Dankovskij"
}

Request BODY:

{
    "id": 1
}
  • Get User:
GET http://PASTE_SERVICE_IP_HERE/user/1
BODY:

NONE

Request BODY:

{
    "id": 1,
    "name": ​"Daniil Dankovskij",
    "balance": 700
}

If you want to cleanup your GCloud, just run simple command:

./deploy.sh annihilate