AWS code pipeline for building unity webgl build - facing issue while executing unity commands

I have created AWS codepipeline for building unity application and also specified buildspec.yml for the same. But facing issue while executing unity commands.Below command I am using.

CMD: xvfb-run --auto-servernum --server-args=‘-screen 0 640x480x24’ /opt/unity/Editor/Unity -quit -batchmode -projectPath . -executeMethod WebGLBuilder.build ‘{BUILD_OUTPUT_FOLDER}/{BUILD_OUTPUT_NAME} -logfile /dev/stdout’

Error: COMMAND_EXECUTION_ERROR:
Error while executing command: eval {UNITY_COMMAND} -projectPath . -executeMethod WebGLBuilder.build '{BUILD_OUTPUT_FOLDER}/${BUILD_OUTPUT_NAME} -logfile /dev/stdout’. Reason: exit status 1

I moved the thread. What instructions are you following, can you share the documentation? Does this pipeline work when you run it locally? Instead of using placeholders as you have, what if you hard code the entire command? (to help troubleshoot) Does the project build correctly from the Editor?

We have attached ‘buildspec.yml’, please have a look & let us know where we are making mistakes.

As we are doing this one first time, we are trying to develop CI/CD pipeline for our unity project on AWS.

We are able to create webgl build through command line locally using this command ‘Unity -quit -batchmode -executeMethod WebGLBuilder.build’.

you can find more details about that from follwing link
Command line flag to build WebGL - Questions & Answers - Unity Discussions

We are using docker image to create the unity webgl build.
‘unityci/editor:ubuntu-2020.3.12f1-webgl-1.0.0’.

We have also tried to follow this one ‘Building Unity3D Apps with AWS CodePipeline | by Michael Sanders | Medium’.

still we are facing the same error
Error: COMMAND_EXECUTION_ERROR:
Error while executing command: eval {UNITY_COMMAND} -projectPath . -executeMethod WebGLBuilder.build '{BUILD_OUTPUT_FOLDER}/${BUILD_OUTPUT_NAME} -logfile /dev/stdout’. Reason: exit status 1

one more concern if you can suggest us which approach we can use for implementing CI/CD pipeline for unity projects.

As mentioned, simplify and run from the command line without the { } placeholders for easier troubleshooting.

We have tried with the below command
xvfb-run --auto-servernum --server-args=‘-screen 0 640x480x24’ /opt/unity/Editor/Unity -batchmode -quit -projectPath . -nographics -executeMethod WebGLBuilder.build

We are getting this error.

Let us know what mistake we are making in command.

Did you install Unity and WebGL support on this server? It looks like your class method WebGLBuilder.build works locally, but is not found on the server.