pachu
pachu

Reputation: 1

Jenkins: How to execute a python program Remotely on windows slave

This is regarding executing a files python files in remote PC from jenkins using SSH

I have installed Jenkins on a Windows 10 PC.

The Remote PC is also a Windows 10 PC, which has anaconda3 installed and also OpenSSH servr

In Manage Jenkins -> Configure system -> SSH Remote hosts , i have set the host IP (Remote PC IP) , port (22) and credentials.

From the Jenkins PC, i have created a free style project, and entered the below command by choosing the a prebuild option "Execute shell script on remote host using SSH"

The commands i used are as below.

date

cd d:\MyAppFolder

py .\bin\myApp.py

When i build the jenkins job, it prints the date and also the CD command seems to succeed. Next i see that the python scripts does execute, but fails to import modules. So i think,the python script is not executing in the required conda environment.

I have installed all required moduels in the base conda environment, in the remote PC.

How do i activate the conda base environment in the remote PC and execute the python script from jenkins job?

thanks and regards

Upvotes: 0

Views: 103

Answers (0)

Related Questions