예제 #1
0
 def run(self):
     prompt_user(
         'Please ensure that all GitHub issues included in this release '
         'have been closed.')
     prompt_user(
         'Please log in to readthedocs.org and ensure the %s tag has '
         'been built.' % VERSION)
예제 #2
0
 def run(self):
     prompt_user(
         'Please ensure that all GitHub issues included in this release '
         'have been closed.')
     prompt_user(
         'Please log in to readthedocs.org and ensure the %s tag has '
         'been built.' % VERSION)
     prompt_user(
         'Please be sure to merge master back into develop and push.')
     prompt_user('Please archive all finished issues on '
                 '<https://waffle.io/jantman/awslimitchecker>')
     prompt_user('Remember to blog/tweet/etc. about the new version.')
예제 #3
0
 def run(self):
     result = None
     while result is not True:
         md = self._gh._get_markdown()
         print("Changelog Markdown:\n%s\n" % md)
         result = prompt_user('Does this markdown look right?')
         if result is not True:
             input('Revise Changelog and then press any key.')
             continue
         url = self._gh._gist(md)
         logger.info('Gist URL: <%s>', url)
         result = prompt_user('Does the gist at <%s> look right?' % url)
     self._ensure_pushed()
예제 #4
0
 def run(self):
     result = None
     while result is not True:
         md = self._gh._get_markdown()
         print("Changelog Markdown:\n%s\n" % md)
         result = prompt_user('Does this markdown look right?')
         if result is not True:
             input('Revise Changelog and then press any key.')
             continue
         url = self._gh._gist(md)
         logger.info('Gist URL: <%s>', url)
         result = prompt_user('Does the gist at <%s> look right?' % url)
     self._ensure_pushed()
예제 #5
0
 def run(self):
     projdir = self.projdir
     if not prompt_user('Ready to upload to PyPI?'):
         fail('Not ready to upload to PyPI.')
     env = deepcopy(os.environ)
     env['PATH'] = self._fixed_path(projdir)
     cmd = ' '.join(['twine', 'upload', 'dist/*'])
     logger.info(
         'Running: %s (cwd=%s)', cmd, projdir
     )
     res = subprocess.run(
         cmd, stdout=subprocess.PIPE,
         stderr=subprocess.STDOUT,
         cwd=projdir, timeout=1800, env=env, shell=True
     )
     if res.returncode != 0:
         logger.error(
             'ERROR: command exited %d:\n%s',
             res.returncode, res.stdout.decode()
         )
         fail('%s failed.' % cmd)
     logger.info(
         'Package generated and uploaded to live/production PyPI.')
     res = self.pypi_has_version(VERSION)
     while not res:
         logger.info(
             'Waiting for new version to show up on PyPI...')
         sleep(10)
         res = self.pypi_has_version(VERSION)
     logger.info('Package is live on PyPI.')
예제 #6
0
 def run(self):
     logger.info(
         'Readme URL: <https://github.com/jantman/awslimitchecker/blob/%s/'
         'README.rst>', self._current_branch
     )
     if not prompt_user('Does the Readme at the above URL render properly?'):
         fail('Please fix the README and then re-run.')
예제 #7
0
 def run(self):
     logger.info(
         'Readme URL: <https://github.com/jantman/awslimitchecker/blob/%s/'
         'README.rst>', self._current_branch
     )
     if not prompt_user('Does the Readme at the above URL render properly?'):
         fail('Please fix the README and then re-run.')
예제 #8
0
 def run(self):
     projdir = self.projdir
     if not prompt_user('Ready to upload to PyPI?'):
         fail('Not ready to upload to PyPI.')
     env = deepcopy(os.environ)
     env['PATH'] = self._fixed_path(projdir)
     cmd = ' '.join(['twine', 'upload', 'dist/*'])
     logger.info(
         'Running: %s (cwd=%s)', cmd, projdir
     )
     res = subprocess.run(
         cmd, stdout=subprocess.PIPE,
         stderr=subprocess.STDOUT,
         cwd=projdir, timeout=1800, env=env, shell=True
     )
     if res.returncode != 0:
         logger.error(
             'ERROR: command exited %d:\n%s',
             res.returncode, res.stdout.decode()
         )
         fail('%s failed.' % cmd)
     logger.info(
         'Package generated and uploaded to live/production PyPI.')
     res = self.pypi_has_version(VERSION)
     while not res:
         logger.info(
             'Waiting for new version to show up on PyPI...')
         sleep(10)
         res = self.pypi_has_version(VERSION)
     logger.info('Package is live on PyPI.')
예제 #9
0
 def run(self):
     logger.info('Running dev/update_integration_iam_policy.py')
     IntegrationIamPolicyUpdater().run()
     self._ensure_committed()
     if not prompt_user(
             'Are any IAM permission changes clearly documented in the '
             'changelog?'):
         fail('Please update CHANGES.rst with any new IAM permissions.')
예제 #10
0
 def run(self):
     logger.info('Running dev/terraform.py')
     TerraformIAM().run()
     self._ensure_committed()
     if not prompt_user(
             'Are any IAM permission changes clearly documented in the '
             'changelog?'):
         fail('Please update CHANGES.rst with any new IAM permissions.')
예제 #11
0
 def run(self):
     prompt_user(
         'Please ensure that all GitHub issues included in this release '
         'have been closed.'
     )
     prompt_user(
         'Please log in to readthedocs.org and ensure the %s tag has '
         'been built.' % VERSION
     )
     prompt_user(
         'Please be sure to merge master back into develop and push.'
     )
     prompt_user(
         'Please archive all finished issues on '
         '<https://waffle.io/jantman/awslimitchecker>'
     )
     prompt_user('Remember to blog/tweet/etc. about the new version.')
예제 #12
0
 def run(self):
     b = self._current_branch
     if b == 'master':
         fail('release.py cannot be run from master for a new release')
     rbranch = 'issues/%d' % self._release_issue_num
     if b != rbranch:
         fail(
             'You must run this script from a release branch called '
             '"%s"' % rbranch
         )
     if not prompt_user(
         'Have you confirmed that there are CHANGES.rst entries for all '
         'major changes?'
     ):
         fail('Please check CHANGES.rst before releasing code.')
     if not prompt_user(
         'Is the current version (%s) the version being released?' % VERSION
     ):
         fail(
             'Please increment the version in awslimitchecker/version.py '
             'before running the release script.'
         )
     # check for proper CHANGES.rst heading
     have_ver = False
     last_line = ''
     expected = '%s (%s)' % (VERSION, datetime.now().strftime('%Y-%m-%d'))
     with open(os.path.join(self.projdir, 'CHANGES.rst'), 'r') as fh:
         for line in fh.readlines():
             line = line.strip()
             if (
                 line == '------------------' and
                 last_line == expected
             ):
                 have_ver = True
                 break
             last_line = line
     if not have_ver:
         fail('Expected to find a "%s" heading in CHANGES.rst, but did not. '
              'Please ensure there is a changelog heading for this release.'
              '' % expected)
     if not prompt_user(
         'Is the test coverage at least as high as the last release, and '
         'are there acceptance tests for all non-trivial changes?'
     ):
         fail('Test coverage!!!')
예제 #13
0
 def run(self):
     b = self._current_branch
     if b == 'master':
         fail('release.py cannot be run from master for a new release')
     rbranch = 'issues/%d' % self._release_issue_num
     if b != rbranch:
         fail(
             'You must run this script from a release branch called '
             '"%s"' % rbranch
         )
     if not prompt_user(
         'Have you confirmed that there are CHANGES.rst entries for all '
         'major changes?'
     ):
         fail('Please check CHANGES.rst before releasing code.')
     if not prompt_user(
         'Is the current version (%s) the version being released?' % VERSION
     ):
         fail(
             'Please increment the version in awslimitchecker/version.py '
             'before running the release script.'
         )
     # check for proper CHANGES.rst heading
     have_ver = False
     last_line = ''
     expected = '%s (%s)' % (VERSION, datetime.now().strftime('%Y-%m-%d'))
     with open(os.path.join(self.projdir, 'CHANGES.rst'), 'r') as fh:
         for line in fh.readlines():
             line = line.strip()
             if (
                 line == '------------------' and
                 last_line == expected
             ):
                 have_ver = True
                 break
             last_line = line
     if not have_ver:
         fail('Expected to find a "%s" heading in CHANGES.rst, but did not. '
              'Please ensure there is a changelog heading for this release.'
              '' % expected)
     if not prompt_user(
         'Is the test coverage at least as high as the last release, and '
         'are there acceptance tests for all non-trivial changes?'
     ):
         fail('Test coverage!!!')
예제 #14
0
 def run(self):
     logger.info('Running dev/update_integration_iam_policy.py')
     IntegrationIamPolicyUpdater().run()
     self._ensure_committed()
     if not prompt_user(
             'Are any IAM permission changes clearly documented in the '
             'changelog?'
     ):
         fail('Please update CHANGES.rst with any new IAM permissions.')
예제 #15
0
 def run(self):
     b = self._current_branch
     if b == 'master':
         fail('release.py cannot be run from master for a new release')
     if not prompt_user(
             'Is the current branch (%s) the release branch?' % b):
         fail('You must run this script from the release branch.')
     if not prompt_user(
             'Have you verified whether or not DB migrations are needed, and '
             'if acceptance tests have been written for any migrations that '
             'manipulate data?'):
         fail(
             'You must verify migrations first. For information on testing '
             'migrations that manipulate data, see '
             'biweeklybudget/tests/migrations/migration_test_helpers.py')
     if not prompt_user(
             'Have you confirmed that there are CHANGES.rst entries for all '
             'major changes?'):
         fail('Please check CHANGES.rst before releasing code.')
     if not prompt_user(
             'Is the current version (%s) the version being released?' %
             VERSION):
         fail('Please increment the version in biweeklybudget/version.py '
              'before running the release script.')
     # check for proper CHANGES.rst heading
     have_ver = False
     last_line = ''
     expected = '%s (%s)' % (VERSION, datetime.now().strftime('%Y-%m-%d'))
     with open(os.path.join(self.projdir, 'CHANGES.rst'), 'r') as fh:
         for line in fh.readlines():
             line = line.strip()
             if (line == '------------------' and last_line == expected):
                 have_ver = True
                 break
             last_line = line
     if not have_ver:
         fail(
             'Expected to find a "%s" heading in CHANGES.rst, but did not. '
             'Please ensure there is a changelog heading for this release.'
             '' % expected)
     if not prompt_user(
             'Is the test coverage at least as high as the last release, and '
             'are there acceptance tests for all non-trivial changes?'):
         fail('Test coverage!!!')
예제 #16
0
 def run(self):
     logger.info('Running release Docker image build')
     tox_output = self._run_tox_env(
         'docker', extra_env_vars={'DOCKER_BUILD_VER': VERSION})
     logger.info('Tox output:\n%s', tox_output)
     m = re.search(r'Image "([^"]+)" built and tested\.', tox_output)
     if m is None:
         fail('Error: could not find build image tag in tox output.')
     tag = m.group(1)
     img_name = 'jantman/biweeklybudget'
     self._prompt_tag(img_name, tag, VERSION)
     self._prompt_tag(img_name, tag, 'latest')
     if not prompt_user('Push images to Docker Hub?'):
         fail('Do not push.')
     self._push_docker(img_name, VERSION)
     self._push_docker(img_name, 'latest')
예제 #17
0
 def run(self):
     projdir = self.projdir
     logger.info('Removing dist directory...')
     rmtree(os.path.join(projdir, 'dist'))
     env = deepcopy(os.environ)
     env['PATH'] = self._fixed_path(projdir)
     cmd = ['python', 'setup.py', 'sdist', 'bdist_wheel']
     logger.info(
         'Running: %s (cwd=%s)', ' '.join(cmd), projdir
     )
     res = subprocess.run(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
         cwd=projdir, timeout=1800, env=env
     )
     if res.returncode != 0:
         logger.error(
             'ERROR: command exited %d:\n%s',
             res.returncode, res.stdout.decode()
         )
         fail('%s failed.' % ' '.join(cmd))
     cmd = ' '.join(['twine', 'upload', '-r', 'test', 'dist/*'])
     logger.info(
         'Running: %s (cwd=%s)', cmd, projdir
     )
     res = subprocess.run(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
         cwd=projdir, timeout=1800, env=env, shell=True
     )
     if res.returncode != 0:
         logger.error(
             'ERROR: command exited %d:\n%s',
             res.returncode, res.stdout.decode()
         )
         fail('%s failed.' % ' '.join(cmd))
     logger.info('Package generated and uploaded to Test PyPI.')
     res = self.pypi_has_version(VERSION, test=True)
     while not res:
         logger.info('Waiting for new version to show up on TestPyPI...')
         sleep(10)
         res = self.pypi_has_version(VERSION, test=True)
     logger.info(
         'Package is live on Test PyPI. URL: <https://testpypi.python.org/'
         'pypi/awslimitchecker>'
     )
     if not prompt_user('Does the Readme at the above URL render properly?'):
         fail('Please fix the README and then re-run.')
예제 #18
0
 def run(self):
     projdir = self.projdir
     logger.info('Removing dist directory...')
     rmtree(os.path.join(projdir, 'dist'))
     env = deepcopy(os.environ)
     env['PATH'] = self._fixed_path(projdir)
     cmd = ['python', 'setup.py', 'sdist', 'bdist_wheel']
     logger.info(
         'Running: %s (cwd=%s)', ' '.join(cmd), projdir
     )
     res = subprocess.run(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
         cwd=projdir, timeout=1800, env=env
     )
     if res.returncode != 0:
         logger.error(
             'ERROR: command exited %d:\n%s',
             res.returncode, res.stdout.decode()
         )
         fail('%s failed.' % ' '.join(cmd))
     cmd = ' '.join(['twine', 'upload', '-r', 'test', 'dist/*'])
     logger.info(
         'Running: %s (cwd=%s)', cmd, projdir
     )
     res = subprocess.run(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
         cwd=projdir, timeout=1800, env=env, shell=True
     )
     if res.returncode != 0:
         logger.error(
             'ERROR: command exited %d:\n%s',
             res.returncode, res.stdout.decode()
         )
         fail('%s failed.' % ' '.join(cmd))
     logger.info('Package generated and uploaded to Test PyPI.')
     res = self.pypi_has_version(VERSION, test=True)
     while not res:
         logger.info('Waiting for new version to show up on TestPyPI...')
         sleep(10)
         res = self.pypi_has_version(VERSION, test=True)
     logger.info(
         'Package is live on Test PyPI. URL: <https://testpypi.python.org/'
         'pypi/awslimitchecker>'
     )
     if not prompt_user('Does the Readme at the above URL render properly?'):
         fail('Please fix the README and then re-run.')
예제 #19
0
 def _prompt_tag(self, img_name, orig_tag, new_tag):
     if not prompt_user('Tag %s:%s as %s:%s ?' %
                        (img_name, orig_tag, img_name, new_tag)):
         fail('Error.')
     cmd = [
         'docker', 'tag',
         '%s:%s' % (img_name, orig_tag),
         '%s:%s' % (img_name, new_tag)
     ]
     logger.info('Running: %s', ' '.join(cmd))
     res = subprocess.run(cmd,
                          stdout=subprocess.PIPE,
                          stderr=subprocess.STDOUT,
                          timeout=1800)
     if res.returncode != 0:
         logger.error('ERROR: command exited %d:\n%s', res.returncode,
                      res.stdout.decode())
         fail('%s failed.' % ' '.join(cmd))
     logger.info('Docker image tagged as %s', new_tag)
예제 #20
0
 def run(self):
     commit = self._current_commit
     logger.info('Polling for finished TravisCI build of %s', commit)
     build = self._travis.commit_latest_build_status(commit)
     while build is None or build.finished is False:
         sleep(10)
         build = self._travis.commit_latest_build_status(commit)
     logger.info('Travis build finished')
     if not build.passed:
         fail(
             'Travis build %s (%s) did not pass. Please fix build failures '
             'and then re-run.' % (build.number, build.id))
     logger.info('OK, Travis build passed.')
     logger.info(
         'Build URL: <https://travis-ci.org/jantman/awslimitchecker/'
         'builds/%s>', build.id)
     if not prompt_user(
             'Is the test coverage at least as high as the last release, and '
             'are there acceptance tests for all non-trivial changes?'):
         fail('Test coverage!!!')
예제 #21
0
 def run(self):
     commit = self._current_commit
     logger.info('Polling for finished TravisCI build of %s', commit)
     build = self._travis.commit_latest_build_status(commit)
     while build is None or build.finished is False:
         sleep(10)
         build = self._travis.commit_latest_build_status(commit)
     logger.info('Travis build finished')
     if not build.passed:
         fail('Travis build %s (%s) did not pass. Please fix build failures '
              'and then re-run.' % (build.number, build.id))
     logger.info('OK, Travis build passed.')
     logger.info(
         'Build URL: <https://travis-ci.org/jantman/awslimitchecker/'
         'builds/%s>', build.id
     )
     if not prompt_user(
         'Is the test coverage at least as high as the last release, and '
         'are there acceptance tests for all non-trivial changes?'
     ):
         fail('Test coverage!!!')
예제 #22
0
 def run(self):
     projdir = self.projdir
     env = deepcopy(os.environ)
     env['PATH'] = self._fixed_path(projdir)
     cmd = os.path.join(projdir, 'dev', 'terraform.py')
     logger.info('Running %s in cwd %s', cmd, projdir)
     res = subprocess.run(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
         cwd=projdir
     )
     logger.info('dev/terraform.py process exited %d', res.returncode)
     if res.returncode != 0:
         logger.error('ERROR: terraform exitcode %d', res.returncode)
         logger.error(
             'dev/terraform.py output:\n%s', res.stdout.decode()
         )
         res.check_returncode()
     self._ensure_committed()
     if not prompt_user(
             'Are any IAM permission changes clearly documented in the '
             'changelog?'
     ):
         fail('Please update CHANGES.rst with any new IAM permissions.')
예제 #23
0
 def run(self):
     md = self._gh._get_markdown()
     print("Markdown:\n%s\n" % md)
     if not prompt_user('Does this look right?'):
         fail('Changelog apparently does not look right.')
     self._gh._release(md)
예제 #24
0
 def run(self):
     md = self._gh._get_markdown()
     print("Markdown:\n%s\n" % md)
     if not prompt_user('Does this look right?'):
         fail('Changelog apparently does not look right.')
     self._gh._release(md)