def environment_variables_for_task(task):
env = {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT:true>',<EOL>'<STR_LIT>': '<STR_LIT:true>',<EOL>'<STR_LIT>': task['<STR_LIT>'],<EOL>'<STR_LIT>': task['<STR_LIT>'],<EOL>'<STR_LIT>': task['<STR_LIT>'],<EOL>'<STR_LIT>': '<STR_LIT>'.format(task['<STR_LIT:id>']),<EOL>'<STR_LIT>': task['<STR_LIT:id>'],<EOL>'<STR_LIT>': task['<STR_LIT:image>'],<EOL>'<STR_LIT>': socket.getfqdn(),<EOL>}<EOL>if '<STR_LIT>' in task:<EOL><INDENT>env['<STR_LIT>'] = task['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in task:<EOL><INDENT>env['<STR_LIT>'] = task['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in task:<EOL><INDENT>env.update(task['<STR_LIT>'])<EOL><DEDENT>if '<STR_LIT>' in task:<EOL><INDENT>env.update(task['<STR_LIT>'])<EOL><DEDENT>return env<EOL>
This will build a dict with all the environment variables that
should be present when running a build or deployment.

:param task: A dict of the json payload with information about
             the build task.
:return: A dict of environment variables.