How to use the @jenkins-cd/blueocean-core-js.pipelineService.fetchPipeline function in @jenkins-cd/blueocean-core-js

To help you get started, we’ve selected a few @jenkins-cd/blueocean-core-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / creation / git / GitFlowManager.jsx View on Github external
if (
            event.blueocean_job_pipeline_name === this.pipelineName &&
            event.jenkins_object_type === 'org.jenkinsci.plugins.workflow.job.WorkflowRun' &&
            (event.job_run_status === 'ALLOCATED' ||
                event.job_run_status === 'RUNNING' ||
                event.job_run_status === 'SUCCESS' ||
                event.job_run_status === 'FAILURE')
        ) {
            // set pipeline details thats needed later on in BbCompleteStep.navigatePipeline()
            this.pipeline = { organization: event.jenkins_org, fullName: this.pipelineName };
            this._finishListening(STATE.STEP_COMPLETE_SUCCESS);
            return;
        }

        if (event.job_multibranch_indexing_result) {
            pipelineService
                .fetchPipeline(event.blueocean_job_rest_url, { useCache: false })
                .then(pipeline => {
                    if (!pipeline.branchNames.length && isSshRepositoryUrl(this.repositoryUrl)) {
                        this._finishListening(STATE.STEP_COMPLETE_MISSING_JENKINSFILE);
                    } else {
                        this._finishListening(STATE.STEP_COMPLETE_SUCCESS);
                    }
                })
                .catch(() => {
                    this._finishListening(STATE.STEP_COMPLETE_EVENT_ERROR);
                });
        }
    }
}
github jenkinsci / blueocean-plugin / blueocean-pipeline-editor / src / main / js / EditorPage.jsx View on Github external
loadPipelineMetadata() {
        const { organization, pipeline } = this.props.params;
        const split = pipeline.split('/');
        const team = split[0];
        this.href = Paths.rest.pipeline(organization, team);
        return pipelineService
            .fetchPipeline(this.href, { useCache: true })
            .then(pipeline => this._savePipelineMetadata(pipeline))
            .catch(err => {
                this.showErrorDialog(err);
            });
    }
github jenkinsci / blueocean-plugin / blueocean-pipeline-editor / src / main / js / PipelineEditorLink.jsx View on Github external
_loadPipeline() {
        const { pipeline } = this.props;
        const folder = pipeline.fullName.split('/')[0];
        const href = Paths.rest.apiRoot() + '/organizations/' + pipeline.organization + '/pipelines/' + folder + '/';
        pipelineService.fetchPipeline(href, { useCache: true, disableCapabilities: false }).then(pipeline => {
            if (this._canSavePipeline(pipeline)) {
                this.setState({ supportsSave: true });
            }
        });
    }