geeklearningio / gl-vsts-tasks-yarn

Yarn Package Manager Visual Studio Team Services Build and Release Management extensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to run other Yarn comands

jvskriubakken opened this issue · comments

Before opening an issue please read this.

Are you reporting a bug or a feature request ?

  • Bug
  • Feature request

Description

I thought this plugin was going to help me with using Yarn in Azure to run different Yarn run xxx commands. It this Azure Task supposed to work in this way?

Cannot find any docs on it either, so I am beginning to wonder.

It has two tasks on is to install yarn the other one is to use yarn.

I handles authentification with package feeds (if you need) and you can pass an arts that you want to yarn. Just like you would normally do using yarn.

The possibility to execute any Yarn command and automatic authentication towards package feeds is what I need. So that sounds promising. But I cannot understand from the documentation how to run any Yarn command.

When I try something like this:

  task: Yarn@3
    displayName: "Test"
    inputs:
      projectDirectory: "src/${{parameters.projectName}}"
      arguments: "run test-ci"
      customRegistry: useFeed
      customFeed: "0000000-0000000-0000000-0000000"

I get the error:

"Mapping values are not allowed in this context"

Do you have any example on how to run a given script task or any other Yarn command for that sake?

That would be very helpful!

Thanks :)

I figured out my problem. It was incorrect indention in the task definitions that caused the error.

I'm adding an example on how to run a script in package.json named "test-ci" using Yarn@3 for others having the same noob problems :)


- task: Yarn@3
  displayName: 'Test'
  inputs:
    projectDirectory: "src/${{parameters.projectName}}"
    arguments: 'run test-ci'

YAML... 😅

You didn’t find the wiki page? https://github.com/geeklearningio/gl-vsts-tasks-yarn/wiki/Yarn

It’s linked in the overview of the extension and readme of the github. Any suggestions on making it more visible?

I've read the page many times :) But, lacking a clear example on how to run other commands (other than the implicit yarn install command) in combination with my YAML struggles made me doubt the Yarn task possibilities :)

So just adding another example with different arguments?

Yes, I think that will clarify.