Signing Android App With Gradle Using CLI

Recently I stumbled upon a problem of creating a signed Android app via command line, after spending some time on this, I have decided to post following tutorial. This problem exist in 2 situations. For example when you want to share your application publicly, but do not want to share any details about your signing key or you would like to automate building process using some kind of CI server.