question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

wait for pipeline to finish

See original GitHub issue

I am struggling a little to create a reference to a collection of files as a parameter to a plugin in another pipeline. I am not sure which way to go:

Gulp.task('collection', function() {

  return Gulp.src('some/**/*.md')
    .pipe($.frontmatter());

});

Gulp.task('templates', [ 'collection' ], function() {

  var other = Gulp.src('other/**/*.md')
    .pipe($.template({
      collection: -> reference to the finished collection
    }))

  ...
});

or better

Gulp.task('templates', [ 'collection' ], function() {

  var collection = Gulp.src('some/**/*.md')
    .pipe($.frontmatter());

  var other = Gulp.src('other/**/*.md')
    .pipe($.template({
      collection: -> reference to the finished collection
    }))

  ...
});

I would love to do this in a single task but given the pipeline architecture that doesn’t seem so easy. Any pointers much appreciated.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

91reactions
TrySoundcommented, Jul 31, 2015

@tcurdt

gulp.task('task', function () {
  return Promise.all([
    new Promise(function(resolve, reject) {
      gulp.src(src + '/*.md')
        .pipe(plugin())
        .on('error', reject)
        .pipe(gulp.dest(dist))
        .on('end', resolve)
    }),
    new Promise(function(resolve, reject) {
      gulp.src(src + '/*.md')
        .pipe(plugin())
        .on('error', reject)
        .pipe(gulp.dest(dist))
        .on('end', resolve)
    })
  ]).then(function () {
    // Other actions
  });
});
2reactions
tcurdtcommented, Jul 31, 2015

@TrySound oh - that easy?

I thought that only returning a pipeline would run it. What runs the pipeline like this? Doesn’t gulp.src().pipe().pipe().on() just create the pipeline?

Doesn’t it need to be

gulp.task('task', function () {

  var collection;

  return Promise.all([
    new Promise(function(resolve, reject) {
      collection = gulp.src(src + '/*.md')
        .pipe(plugin())
        .on('error', reject)
        .pipe(gulp.dest(dist))
        .on('end', resolve)
    })
  ]).then(function () {

    var other = Gulp.src('other/**/*.md')
      .pipe($.template({
        collection: -> reference to the finished collection
      }))

    return merge(collection, other);

  });
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Wait for pipeline to finish - Visual Studio Feedback
Currently I have a build pipeline that is calling another build pipeline, ... Is there a way to "wait" for pipeline 2 to...
Read more >
Azure DevOps Release - Trigger Build pipeline and wait to finish
1 Answer 1 · 1.Intasll this Azure DevOps Extension · 2.In your another build pipeline, add "trigger build task" to trigger the build,...
Read more >
Can a release pipeline wait for a previous pipeline to fully ...
Hello, I know that option but cancelling is not a preferred option. We update work items with tags during and at the end...
Read more >
Pipeline run sequence - Azure - Microsoft Learn
As runtime jobs complete, Azure Pipelines will see if there are new jobs eligible to run. If so, steps 4 - 6 repeat...
Read more >
How to make an Azure DevOps pipeline wait for an external ...
If a certain amount of time has passed without the process finishes successfully, the loop is aborted and the task is failed. Here's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found