Technical test 2 for ANZ - API GoLang app with CI
This is a simple go json https api which will expose 3 different endpoints
/
will return:
{
"Welcome":"Hello World!"
}
/health
will return:
{
"health":"Still alive!"
}
/info
will return:
{
"myapplication":[
{
"version":"v1.0.0",
"lastcommitsha":"f80ff8f841b23cc91511538a9411931b587970ce",
"description":"pre-interview technical test"
}
]
}
- Docker engine
- git
- golang 1.12
To build this api via docker image run the following docker command
docker build . --build-arg version="v1.0.0" --build-arg last_commit_sha=$(git rev-parse --verify HEAD) -t <tag-name>
To run the this api via docker run the following docker command
docker run -p 80:8000 <tag-name>
To test the 3 API endpoint run the following curl commands
curl http://localhost/
{"Welcome":"Hello World!"}
curl http://localhost/health
{"health":"Still alive!"}
curl http://localhost/info
{"myapplication":[ {"version":"v1.0.0","lastcommitsha":"f80ff8f841b23cc91511538a9411931b587970ce", "description":"pre-interview technical test"}]}
this repo has a travis CI pipeline that will push to docker hub
- No logging
- No monitoring
- Only http
- Version is set in docker file
- No deployment to anywhere
- add logging
- add monitoring
- add https
- add deployment to a kubernetes
- create auto versioning