Hi tarun k
As we discussed in private message, in your file, there is tosca client file but tosca events.xml file is not there
firstly, make sure your repo structure should be like this
Docker-Windows-Agent/
├── optionalp/
│ └── Dockerfile
├── install_build_tools/
├── Toscha/
│ ├── ToscaCIClient.exe
│ ├── ToscaCIClient.log
│ ├── ToscaCIExecution.dll
│ ├── TOSCACIEvent.json
│ ├── ToscaCIJavaClient.jar
│ └── etc...
Inside optionalp/Dockerfile
,
WORKDIR /scripts
COPY install_build_tools/* ./
then add this in your docker file,
# Copy Tosca binaries into container
COPY ./Toscha/ "C:/Tosca/"
Make sure the script sets environment variables and checks for the main executable:
Write-Host "Configuring Tosca..."
$ToscaPath = "C:\Tosca"
# Set environment vars
[Environment]::SetEnvironmentVariable("TOSCA_HOME", $ToscaPath, "Machine")
[Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";$ToscaPath", "Machine")
# Validate installation
if (!(Test-Path "$ToscaPath\ToscaCIClient.exe")) {
Write-Error "ToscaCIClient.exe is missing at $ToscaPath"
exit 1
}
Write-Host "Tosca installed successfully."
The Dockerfile already runs this:
RUN powershell -ExecutionPolicy Bypass -File install_tosca.ps1 $AUSER $env:AUSER $APASS $env:APASS
So, this script will automatically run inside the container build.
From the optionalp
folder, run this command to create a Windows container image with Tosca preloaded in C:\Tosca
.
docker build -t myagent-with-tosca .
Once your container agent is running and registered with Azure DevOps, use the Tosca tools in your pipeline like this:
- script: |
C:\Tosca\ToscaCIClient.exe /run /workspace "C:\Tosca\MyWorkspace" /someOption
displayName: 'Run Tosca Test'
Hope this helps!
Please Let me know if you have any queries.