Added deis_env variable to build

Hopefully fixes #1879 untested at current. Looking to test this later on.