0

This is my script, but I don't know how to properly declare my workingDirectory path.

# Node.js with Vue
# Build a Node.js project that uses Vue.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://learn.microsoft.com/azure/devops/pipelines/languages/javascript

trigger:
- main

pool:
  vmImage: ubuntu-latest

steps:
- task: NodeTool@0
  inputs:
    versionSpec: '10.x'
  displayName: 'Install Node.js'

This is the area of my script that I don;t know if I am properly declaring.

- script: |
    npm install
    npm install --save axios vue-router
    npm install --save @fortawesome/fontawesome-free
    npm run build
  displayName: 'npm install and build'
  workingDirectory: '/home/vsts/work/1/s/countries'
Marcello B.
  • 4,177
  • 11
  • 45
  • 65

1 Answers1

0

Based on your description, you need to confirm the path of the package.json file in your project.

By default, the source file will be download to (build.sourcesdirectory)

Then you could define the workingDirectory in the script task.

For example: $(build.sourcesdirectory)\foldername(the package.json file location)

File structure:

enter image description here

Yaml sample:

- script: 'npm install'
  workingDirectory: '$(build.sourcesdirectory)/pack'
  displayName: 'Command Line Script'

Here is the doc about Pipeline Predefined variables

Kevin Lu-MSFT
  • 20,786
  • 3
  • 19
  • 28