In my build pipeline, I'm trying to run the below task:
The main responsibility of the task is to mount the volume for Test
and the Script
from the AzDo to the container's working dir which is /app/
and then run the test
(basically it will run npm test inside the container). But unfortunately, I don't see any outcomes. Hence I changed the command as ls -ltrR /app
at the end of the docker run to check if the files are copied or not. But I see the directory is created but no files are inside.
So, to prove the files exist in $(System.DefaultWorkingDirectory)
for AzDo. I tried to run all kinds of ls commands
prior to docker-run which shows that the files do exist in the $(System.DefaultWorkingDirectory). But for some reason files are not mapped in docker containers. I tried to use PWD
and $(Build.SourcesDirectory)
but in all cases, it is not working.
I tried to replicate the same docker run command using in my local workstation, it works as expected. So, can anyone suggest how to mount the files in the docker run using AzDo build task?
- task: Bash@3
inputs:
targetType: 'inline'
script: |
echo "check in if Scripts and Tests file exists"
ls -Rtlr ./Script
cat ./Script/dev_blueprint_jest2/MyJavaScript.js
ls -ltrR $PWD/Script
ls -ltr $PWD/Test
ls -ltrR $(Build.SourcesDirectory)/Script/
docker run -v $(System.DefaultWorkingDirectory)/Script/:/app/ScriptStages/ -v $(System.DefaultWorkingDirectory)/Test/:/app/Test/ -i dockerimage ls -ltrR /app/
workingDirectory: $(System.DefaultWorkingDirectory)
displayName: 'Run the JS test pipeline.