Skip to content

fixed test pipeline link #487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/interface/cli/commands/hybrid/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ const DefaultLogFormatter = 'plain';

const defaultOpenIssueMessage = 'If you had any issues with this process please report them at: ' +
`${colors.blue('https://github.com/codefresh-io/cli/issues/new')}`;
const url = _.get(sdk, 'config.context.url', 'https://g.codefresh.io');

async function createTestPipeline(runtimeName, pipelineName, pipelineCommands, progressReporter) {
const url = _.get(sdk, 'config.context.url', 'https://g.codefresh.io');
console.log(`Creating test pipeline with the name: "${colors.cyan(pipelineName)}"`);
const pipeline = await sdk.pipelines.create({ metadata: { name: pipelineName } });

Expand Down Expand Up @@ -62,14 +62,17 @@ async function createTestPipeline(runtimeName, pipelineName, pipelineCommands, p
}

async function getTestPipelineLink(pipelineName) {
const url = _.get(sdk, 'config.context.url', 'https://g.codefresh.io');
const pipelines = await sdk.pipelines.list({ id: pipelineName });
if (_.get(pipelines, 'docs.length')) {
const pipeline = pipelines.docs[0];
return `${url}/pipelines/edit/workflow?id=${pipeline.metadata.id}&pipeline=${encodeURI(pipeline.metadata.name)}`;
}
return '';
}

async function getTestPipeline(pipelineName) {
const url = _.get(sdk, 'config.context.url', 'https://g.codefresh.io');
const pipelines = await sdk.pipelines.list({ id: pipelineName });
if (_.get(pipelines, 'docs.length')) {
const pipeline = pipelines.docs[0];
Expand All @@ -84,6 +87,7 @@ async function getTestPipeline(pipelineName) {
}

async function executeTestPipeline(runtimeName, pipeline, progressReporter) {
const url = _.get(sdk, 'config.context.url', 'https://g.codefresh.io');
const pipelineName = _.get(pipeline, 'metadata.name');

const workflowId = await pipelinesRunCmd.handler({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codefresh",
"version": "0.65.1",
"version": "0.65.2",
"description": "Codefresh command line utility",
"main": "index.js",
"preferGlobal": true,
Expand Down