0
votes

I am basically trying to create build and release pipelines for a react js app.The tasks in the build pipeline include npm install,npm run build,then build and push a docker image using dockerfile(nginx serving the build folder).Then in the release pipeline I want to do a kubectl apply on the nginx yaml. My problem is that the task npm run build is not creating the build folder in the azure repos which is where I pushed my code into.

I tried removing the line "#production /build" from the file gitignore from the azure repos.

Dockerfile used for building image

FROM nginx
COPY /build /usr/share/nginx/html

since the build folder was not created in the azure repos,the build docker image task in the build pipeline keeps failing.Please help

1
Provide the code of package.jsonstarian chen-MSFT

1 Answers

2
votes

Here is a contributor in a case with similar issue giving a solution.

His solution is:

For "npm build" task, the custom command (In question above, tried "build" and "npm run-script build") should be "run-script build". The build has successfully created the dist folder.

For details ,you can refer to this case.