Publishes the branch and opens the pull request
497831
def run!
      story = @configuration.story
      fail("Could not find story associated with branch") unless story
      Git.clean_working_tree?
      Git.push(story.branch_name, set_upstream: true)
      unless story.release?
        print "Creating pull-request on Github... "
        pull_request_params = story.params_for_pull_request.merge(project: @configuration.project)
        @configuration.github_client.create_pullrequest(pull_request_params)
        puts 'OK'
      end
      return 0
    end
471987
def push(remote = 'origin', branch = 'master', opts = {})
      # Small hack to keep backwards compatibility with the 'push(remote, branch, tags)' method signature.
      opts = {:tags => opts} if [true, false].include?(opts)

      self.lib.push(remote, branch, opts)
    end
265149
def publish(self, clear_load):
        '''
        
        '''
        extra = clear_load.get('kwargs', {})

        publisher_acl = salt.acl.PublisherACL(self.opts['publisher_acl_blacklist'])

        if publisher_acl.user_is_blacklisted(clear_load['user']) or \
                publisher_acl.cmd_is_blacklisted(clear_load['fun']):
            log.error(
                '%s does not have permissions to run %s. Please contact '
                'your local administrator if you believe this is in '
                'error.\n', clear_load['user'], clear_load['fun']
            )
            return {'error': {'name': 'AuthorizationError',
                              'message': 'Authorization error occurred.'}}

        # Retrieve the minions list
        delimiter = clear_load.get('kwargs', {}).get('delimiter', DEFAULT_TARGET_DELIM)
        _res = self.ckminions.check_minions(
            clear_load['tgt'],
            clear_load.get('tgt_type', 'glob'),
            delimiter
        )
        minions = _res.get('minions', list())
        missing = _res.get('missing', list())
        ssh_minions = _res.get('ssh_minions', False)

        # Check for external auth calls and authenticate
        auth_type, err_name, key, sensitive_load_keys = self._prep_auth_info(extra)
        if auth_type == 'user':
            auth_check = self.loadauth.check_authentication(clear_load, auth_type, key=key)
        else:
            auth_check = self.loadauth.check_authentication(extra, auth_type)

        # Setup authorization list variable and error information
        auth_list = auth_check.get('auth_list', [])
        err_msg = 'Authentication failure of type "{0}" occurred.'.format(auth_type)

        if auth_check.get('error'):
            # Authentication error occurred: do not continue.
            log.warning(err_msg)
            return {'error': {'name': 'AuthenticationError',
                              'message': 'Authentication error occurred.'}}

        # All Token, Eauth, and non-root users must pass the authorization check
        if auth_type != 'user' or (auth_type == 'user' and auth_list):
            # Authorize the request
            authorized = self.ckminions.auth_check(
                auth_list,
                clear_load['fun'],
                clear_load['arg'],
                clear_load['tgt'],
                clear_load.get('tgt_type', 'glob'),
                minions=minions,
                # always accept find_job
                whitelist=['saltutil.find_job'],
            )

            if not authorized:
                # Authorization error occurred. Do not continue.
                if auth_type == 'eauth' and not auth_list and 'username' in extra and 'eauth' in extra:
                    log.debug('Auth configuration for eauth "%s" and user "%s" is empty', extra['eauth'], extra['username'])
                log.warning(err_msg)
                return {'error': {'name': 'AuthorizationError',
                                  'message': 'Authorization error occurred.'}}

            # Perform some specific auth_type tasks after the authorization check
            if auth_type == 'token':
                username = auth_check.get('username')
                clear_load['user'] = username
                log.debug('Minion tokenized user = "%s"', username)
            elif auth_type == 'eauth':
                # The username we are attempting to auth with
                clear_load['user'] = self.loadauth.load_name(extra)

        # If we order masters (via a syndic), don't short circuit if no minions
        # are found
        if not self.opts.get('order_masters'):
            # Check for no minions
            if not minions:
                return {
                    'enc': 'clear',
                    'load': {
                        'jid': None,
                        'minions': minions,
                        'error': 'Master could not resolve minions for target {0}'.format(clear_load['tgt'])
                    }
                }
        if extra.get('batch', None):
            return self.publish_batch(clear_load, extra, minions, missing)

        jid = self._prep_jid(clear_load, extra)
        if jid is None:
            return {'enc': 'clear',
                    'load': {'error': 'Master failed to assign jid'}}
        payload = self._prep_pub(minions, jid, clear_load, extra, missing)

        # Send it!
        self._send_ssh_pub(payload, ssh_minions=ssh_minions)
        self._send_pub(payload)

        return {
            'enc': 'clear',
            'load': {
                'jid': clear_load['jid'],
                'minions': minions,
                'missing': missing
            }
        }
735668
def finish_rel_branch(relver):
    """"""
    print('finish release branch', relver)
    run('git flow release finish --keepremote -F -p -m "version {ver}" {ver}'.format(ver=relver), hide=True)
184640
function publish() {
			if (!options.distBranch) {
				rbot.log.info('Skipping publishing from "' + pubSrcDir + '" to ' + pubDistDir + ' (no distBranch)');
				return;
			} else if (!commit.releaseId) {
				rbot.log.info('Skipping publishing from "' + pubSrcDir + '" to "' + pubDistDir + '" in branch "'
						+ options.distBranch + '" (no releaseId/tag)');
				return;
			}
			rbot.log.info('Publishing to branch "' + options.distBranch + '"');
			rbot.log.info('Copying publication directories/files from "' + pubSrcDir + '" to "' + pubDistDir + '"');
			// copy all directories/files over that need to be published
			// so that they are not removed by the following steps
			rbot.log.info(utils.copyRecursiveSync(pubSrcDir, pubDistDir, options.distExcludeDirRegExp,
					options.distExcludeFileRegExp).toString());
			// cmd('cp -r ' + path.join(pubSrcDir, '*') + ' ' + pubDistDir);
			chkoutRun(null, publishRun);
			function publishRun() {
				try {
					cmd('git fetch ' + options.repoName + ' ' + options.distBranch);
					pubHash = cmd('git rev-parse HEAD');
				} catch (e) {
					if (util.isRegExp(options.distBranchCreateRegExp) && options.distBranchCreateRegExp.test(e.message)) {
						cmd('git checkout -q --orphan ' + options.distBranch);
					} else {
						throw e;
					}
				}
				if (pubHash) {
					cmd('git checkout -q --track ' + options.repoName + '/' + options.distBranch);
				}
				cmd('git rm -rfq .');
				cmd('git clean -dfq .');
				rbot.log.info('Copying publication directories/files from "' + pubDistDir + '" to "' + commit.buildDir
						+ '"');
				rbot.log.info(utils.copyRecursiveSync(pubDistDir, commit.buildDir).toString());
				// cmd('cp -r ' + path.join(pubDistDir, '*') + '
				// .');

				// give taskateers a chance to update branch file
				// contents
				utils.updateFiles(options.distBranchUpdateFiles, options.distBranchUpdateFunction, commit.buildDir,
						rollCall.error);

				cmd('git add -A');
				cmd('git commit -q -m "' + tmpltData.distBranchPubMsg + '"');
				cmd('git push -f ' + options.repoName + ' ' + options.distBranch);

				rollCall.addRollback(rollbackPublish);
				rollCall.then(pack.publish);
			}
		}
1209552
private void publishEndedEvent() {
        BatchEventsPublisher publisher = getBatchEventsPublisher();
        if (publisher != null) {

            publisher.publishSplitFlowEvent(getSplitName(),
                                            getFlowName(),
                                            getTopLevelInstanceId(),
                                            getTopLevelExecutionId(),
                                            BatchEventsPublisher.TOPIC_EXECUTION_SPLIT_FLOW_ENDED,
                                            correlationId);
        }
    }
72157
def publish(self, load):
        '''
        
        '''
        extra = load.get('kwargs', {})

        publisher_acl = salt.acl.PublisherACL(self.opts['publisher_acl_blacklist'])

        if publisher_acl.user_is_blacklisted(load['user']) or \
                publisher_acl.cmd_is_blacklisted(load['fun']):
            log.error(
                '%s does not have permissions to run %s. Please contact '
                'your local administrator if you believe this is in error.',
                load['user'], load['fun']
            )
            return {'error': {'name': 'AuthorizationError',
                              'message': 'Authorization error occurred.'}}

        # Retrieve the minions list
        delimiter = load.get('kwargs', {}).get('delimiter', DEFAULT_TARGET_DELIM)
        _res = self.ckminions.check_minions(
            load['tgt'],
            load.get('tgt_type', 'glob'),
            delimiter
        )
        minions = _res['minions']

        # Check for external auth calls and authenticate
        auth_type, err_name, key = self._prep_auth_info(extra)
        if auth_type == 'user':
            auth_check = self.loadauth.check_authentication(load, auth_type, key=key)
        else:
            auth_check = self.loadauth.check_authentication(extra, auth_type)

        # Setup authorization list variable and error information
        auth_list = auth_check.get('auth_list', [])
        error = auth_check.get('error')
        err_msg = 'Authentication failure of type "{0}" occurred.'.format(auth_type)

        if error:
            # Authentication error occurred: do not continue.
            log.warning(err_msg)
            return {'error': {'name': 'AuthenticationError',
                              'message': 'Authentication error occurred.'}}

        # All Token, Eauth, and non-root users must pass the authorization check
        if auth_type != 'user' or (auth_type == 'user' and auth_list):
            # Authorize the request
            authorized = self.ckminions.auth_check(
                auth_list,
                load['fun'],
                load['arg'],
                load['tgt'],
                load.get('tgt_type', 'glob'),
                minions=minions,
                # always accept find_job
                whitelist=['saltutil.find_job'],
            )

            if not authorized:
                # Authorization error occurred. Log warning and do not continue.
                log.warning(err_msg)
                return {'error': {'name': 'AuthorizationError',
                                  'message': 'Authorization error occurred.'}}

            # Perform some specific auth_type tasks after the authorization check
            if auth_type == 'token':
                username = auth_check.get('username')
                load['user'] = username
                log.debug('Minion tokenized user = "%s"', username)
            elif auth_type == 'eauth':
                # The username we are attempting to auth with
                load['user'] = self.loadauth.load_name(extra)

        # If we order masters (via a syndic), don't short circuit if no minions
        # are found
        if not self.opts.get('order_masters'):
            # Check for no minions
            if not minions:
                return {
                    'enc': 'clear',
                    'load': {
                        'jid': None,
                        'minions': minions
                    }
                }
        # Retrieve the jid
        if not load['jid']:
            fstr = '{0}.prep_jid'.format(self.opts['master_job_cache'])
            load['jid'] = self.mminion.returners[fstr](nocache=extra.get('nocache', False))
        self.event.fire_event({'minions': minions}, load['jid'])

        new_job_load = {
                'jid': load['jid'],
                'tgt_type': load['tgt_type'],
                'tgt': load['tgt'],
                'user': load['user'],
                'fun': load['fun'],
                'arg': salt.utils.args.parse_input(
                    load['arg'],
                    no_parse=load.get('no_parse', [])),
                'minions': minions,
            }

        # Announce the job on the event bus
        self.event.fire_event(new_job_load, 'new_job')  # old dup event
        self.event.fire_event(new_job_load, salt.utils.event.tagify([load['jid'], 'new'], 'job'))

        # Save the invocation information
        if self.opts['ext_job_cache']:
            try:
                fstr = '{0}.save_load'.format(self.opts['ext_job_cache'])
                self.mminion.returners[fstr](load['jid'], load)
            except KeyError:
                log.critical(
                    'The specified returner used for the external job cache '
                    '"%s" does not have a save_load function!',
                    self.opts['ext_job_cache']
                )
            except Exception:
                log.critical(
                    'The specified returner threw a stack trace:',
                    exc_info=True
                )

        # always write out to the master job cache
        try:
            fstr = '{0}.save_load'.format(self.opts['master_job_cache'])
            self.mminion.returners[fstr](load['jid'], load)
        except KeyError:
            log.critical(
                'The specified returner used for the master job cache '
                '"%s" does not have a save_load function!',
                self.opts['master_job_cache']
            )
        except Exception:
            log.critical(
                'The specified returner threw a stack trace:',
                exc_info=True
            )
        # Altering the contents of the publish load is serious!! Changes here
        # break compatibility with minion/master versions and even tiny
        # additions can have serious implications on the performance of the
        # publish commands.
        #
        # In short, check with Thomas Hatch before you even think about
        # touching this stuff, we can probably do what you want to do another
        # way that won't have a negative impact.
        pub_load = {
            'fun': load['fun'],
            'arg': salt.utils.args.parse_input(
                load['arg'],
                no_parse=load.get('no_parse', [])),
            'tgt': load['tgt'],
            'jid': load['jid'],
            'ret': load['ret'],
        }

        if 'id' in extra:
            pub_load['id'] = extra['id']
        if 'tgt_type' in load:
            pub_load['tgt_type'] = load['tgt_type']
        if 'to' in load:
            pub_load['to'] = load['to']

        if 'kwargs' in load:
            if 'ret_config' in load['kwargs']:
                pub_load['ret_config'] = load['kwargs'].get('ret_config')

            if 'metadata' in load['kwargs']:
                pub_load['metadata'] = load['kwargs'].get('metadata')

            if 'ret_kwargs' in load['kwargs']:
                pub_load['ret_kwargs'] = load['kwargs'].get('ret_kwargs')

        if 'user' in load:
            log.info(
                'User %s Published command %s with jid %s',
                load['user'], load['fun'], load['jid']
            )
            pub_load['user'] = load['user']
        else:
            log.info(
                'Published command %s with jid %s',
                load['fun'], load['jid']
            )
        log.debug('Published command details %s', pub_load)

        return {'ret': {
                    'jid': load['jid'],
                    'minions': minions
                    },
                'pub': pub_load
                }
1282220
def publish_report(report, args, old_commit, new_commit):
    """"""
    # Print the report to stdout unless the user specified --quiet.
    output = ""

    if not args.quiet and not args.gist and not args.file:
        return report

    if args.gist:
        gist_url = post_gist(report, old_commit, new_commit)
        output += "\nReport posted to GitHub Gist: {0}".format(gist_url)

    if args.file is not None:
        with open(args.file, 'w') as f:
            f.write(report.encode('utf-8'))
        output += "\nReport written to file: {0}".format(args.file)

    return output
1347705
def publish(self, *args, **kwargs):
        '''
        
        '''
        user_cb = kwargs.pop('cb', None)

        # If the first channel we grab is inactive, continue fetching until
        # we get an active channel, then put the inactive channels back in
        # the pool. Try to keep the overhead to a minimum.
        channel = self._get_channel()

        if channel and not channel.active:
            inactive_channels = set()
            while channel and not channel.active:
                inactive_channels.add(channel)
                channel = self._get_channel()
            self._free_channels.update(inactive_channels)

        # When the transaction is committed, add the channel back to the pool
        # and call any user-defined callbacks. If there is anything in queue,
        # pop it and call back to publish(). Only do so if the channel is
        # still active though, because otherwise the message will end up at
        # the back of the queue, breaking the original order.
        def committed():
            self._free_channels.add(channel)
            if channel.active and not channel.closed:
                self._process_queue()
            if user_cb is not None:
                user_cb()

        if channel:
            channel.publish_synchronous(*args, cb=committed, **kwargs)
        else:
            kwargs['cb'] = user_cb
            self._queue.append((args, kwargs))
1160401
def publish(self,  cat, **kwargs):
                
                res=request.publish_cat1("POST", self.con, self.token,  cat, kwargs)    
                return res
414941
def _get_pull_requests(self):
        
        for pull in self.repo.pull_requests(
            state="closed", base=self.github_info["master_branch"], direction="asc"
        ):
            if self._include_pull_request(pull):
                yield pull
1076087
def main():
    
    # see:
    # https://packaging.python.org/tutorials/distributing-packages/#uploading-your-project-to-pypi
    twine_repo = os.getenv('TWINE_REPOSITORY_URL') or os.getenv('TWINE_REPOSITORY')
    print('tagging and releasing to %s as %s' % (
        twine_repo,
        os.getenv('TWINE_USERNAME')
    ))

    if not twine_repo:
        raise Exception('cannot release to implicit pypi repository. explicitly set the repo/url.')

    version = subprocess.check_output(['pipenv', 'run', 'python', 'setup.py', '--version']).decode().strip()
    if 'dev' in version:
        raise Exception('cannot release unversioned project: %s' % version)

    print('Preparing environment')
    subprocess.check_call(['git', 'config', '--global', 'user.name', 'monty-bot'])
    subprocess.check_call(['git', 'config', '--global', 'user.email', 'monty-bot@arm.com'])
    url = subprocess.check_output(['git', 'remote', 'get-url', 'origin'])
    branch_name = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'])
    new_url = git_url_ssh_to_https(url.decode())
    subprocess.check_call(['git', 'remote', 'set-url', 'origin', new_url])
    branch_spec = 'origin/%s' % branch_name.decode('utf-8').strip()
    subprocess.check_call(['git', 'branch', '--set-upstream-to', branch_spec])
    print('Committing the changelog & version')
    subprocess.check_call(['git', 'add', 'src/auto_version/__version__.py'])
    subprocess.check_call(['git', 'add', 'CHANGELOG.md'])
    subprocess.check_call(['git', 'add', 'docs/news/*'])
    message = ':checkered_flag: :newspaper: Releasing version %s\n[skip ci]' % version
    subprocess.check_call(['git', 'commit', '-m', message])
    print('Tagging the project')
    subprocess.check_call(['git', 'tag', '-a', version, '-m', 'Release %s' % version])
    print('Pushing changes back to GitHub')
    subprocess.check_call(['git', 'push', '--follow-tags'])
    print('Marking this commit as latest')
    subprocess.check_call(['git', 'tag', '-f', 'latest'])
    subprocess.check_call(['git', 'push', '-f', '--tags'])
    print('Generating a release package')
    subprocess.check_call(
        ['pipenv', 'run', 'python', 'setup.py', 'clean', '--all', 'bdist_wheel', '--dist-dir', 'release-dist'])
    print('Uploading to PyPI')
    subprocess.check_call(['pipenv', 'run', 'python', '-m', 'twine', 'upload', 'release-dist/*'])
    print('Done.')
1015771
protected function handlePublishes()
    {
        $this->publishes([
            __DIR__.'/../config/terminal.php' => config_path('terminal.php'),
        ], 'config');

        $this->publishes([
            __DIR__.'/../resources/views' => base_path('resources/views/vendor/terminal'),
        ], 'views');

        $this->publishes([
            __DIR__.'/../public' => public_path('vendor/terminal'),
        ], 'public');
    }
777865
def publish (self):
        '''
         
        '''
        self.lock.acquire()
        tw = cmdvel2Twist(self.data)
        self.lock.release()
        self.pub.publish(tw)
913007
def push(self, remote, branch=None):
        '''
        '''
        pb = ProgressBar()
        pb.setup(self.name, ProgressBar.Action.PUSH)
        if branch:
            result = remote.push(branch, progress=pb)
        else: #pragma: no cover
            result = remote.push(progress=pb)
        print()
        return result, pb.other_lines
5313
def publish(ctx, test=False):
    """"""
    clean(ctx)
    if test:
        run('python setup.py register -r test sdist bdist_wheel', echo=True)
        run('twine upload dist/* -r test', echo=True)
    else:
        run('python setup.py register sdist bdist_wheel', echo=True)
        run('twine upload dist/*', echo=True)
1295723
def as_pull_request(self):
        
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            "/pulls/".join(self.url.rsplit("/issues/", 1))
        )
        return github.PullRequest.PullRequest(self._requester, headers, data, completed=True)