'Publish the changelog as a github gist.'

def publish_changelog_gist(self):

    description = 'Changelog    for    Spinnaker    {0}'.format(self.__release_version)
    with open(self.__changelog_file, 'r') as clog:
        raw_content_lines = clog.readlines()
        spinnaker_version = '#    Spinnaker    {0}\n'.format(self.__release_version)
        raw_content_lines = ([spinnaker_version] + raw_content_lines)
        timestamp = '{:%Y-%m-%d    %H:%M:%S}'.format(datetime.datetime.utcnow())
        signature = '\n\nGenerated    by    {0}    at    {1}'.format(self.__github_publisher, timestamp)
        raw_content_lines.append(signature)
        content = InputFileContent(''.join(raw_content_lines))
        filename = os.path.basename(self.__changelog_file)
        gist = self.__github.get_user().create_gist(True, {filename: content}, description=description)
        self.__gist_uri = 'https://gist.github.com/{user}/{id}'.format(user=self.__gist_user, id=gist.id)
        print 'Wrote    changelog    to    Gist    at    {0}.'.format(self.__gist_uri)
        os.environ['GIST_URI'] = self.__gist_uri
        return self.__gist_uri
