docs: def write_variables(app_configs=None, out_file='', git_short=''):
      """Append _application.json_ configs to _out_file_, .exports, and .json.
  
      Variables are written in INI style, e.g. UPPER_CASE=value. The .exports file
      contains 'export' prepended to each line for easy sourcing. The .json file
      is a minified representation of the combined configurations.
  
      Args:
          app_configs (dict): Environment configurations from _application.json_
              files, e.g. {'dev': {'elb': {'subnet_purpose': 'internal'}}}.
          out_file (str): Name of INI file to append to.
          git_short (str): Short name of Git repository, e.g. forrest/core.
  
      Returns:
          dict: Configuration equivalent to the JSON output.
      """
      generated = gogoutils.Generator(*gogoutils.Parser(git_short).parse_url(), formats=APP_FORMATS)
  
      json_configs = {}
      for env, configs in app_configs.items():
          if env != 'pipeline':
              instance_profile = generated.iam()['profile']
              rendered_configs = json.loads(
                  get_template(
                      'configs/configs.json.j2',
                      env=env,
                      app=generated.app_name(),
                      profile=instance_profile,
                      formats=generated))
              json_configs[env] = dict(DeepChainMap(configs, rendered_configs))
              region_list = configs.get('regions', rendered_configs['regions'])
              json_configs[env]['regions'] = region_list  # removes regions defined in templates but not configs.
              for region in region_list:
                  region_config = json_configs[env][region]
                  json_configs[env][region] = dict(DeepChainMap(region_config, rendered_configs))
          else:
              default_pipeline_json = json.loads(get_template('configs/pipeline.json.j2', formats=generated))
              json_configs['pipeline'] = dict(DeepChainMap(configs, default_pipeline_json))
  
      LOG.debug('Compiled configs:\n%s', pformat(json_configs))
  
      config_lines = convert_ini(json_configs)
  
      with open(out_file, 'at') as jenkins_vars:
          LOG.info('Appending variables to %s.', out_file)
          jenkins_vars.write('\n'.join(config_lines))
  
      with open(out_file + '.exports', 'wt') as export_vars:
          LOG.info('Writing sourceable variables to %s.', export_vars.name)
          export_vars.write('\n'.join('export {0}'.format(line) for line in config_lines))
  
      with open(out_file + '.json', 'wt') as json_handle:
          LOG.info('Writing JSON to %s.', json_handle.name)
          LOG.debug('Total JSON dict:\n%s', json_configs)
          json.dump(json_configs, json_handle)
  
      return json_configs