cancel
Showing results for 
Search instead for 
Did you mean: 
kuldeeppandey
Mission Specialist
Mission Specialist
  • 2,881 Views

execute python script using script option in build hook

Jump to solution

Hi Team,

Please let me know if there is a way to execute python script (ex abc.py) in build-hook using --script option

 

Regards,

Kuldeep

 

Labels (1)
1 Solution

Accepted Solutions
kuldeeppandey
Mission Specialist
Mission Specialist
  • 2,834 Views

Hi All

I did some research and found below details .We can execute .py file using "command" option and script option:

 

oc set build-hook bc/app --post-commit --script="python /opt/app-root/src/abc.py"
or
oc set build-hook bc/app --post-commit --command -- python /opt/app-root/src/abc.py

After setting build-hook we can validate its execution by starting new build using below command:

oc start-build bc/app -F

Regards,

Kuldeep

 

 

 

 

View solution in original post

1 Reply
kuldeeppandey
Mission Specialist
Mission Specialist
  • 2,835 Views

Hi All

I did some research and found below details .We can execute .py file using "command" option and script option:

 

oc set build-hook bc/app --post-commit --script="python /opt/app-root/src/abc.py"
or
oc set build-hook bc/app --post-commit --command -- python /opt/app-root/src/abc.py

After setting build-hook we can validate its execution by starting new build using below command:

oc start-build bc/app -F

Regards,

Kuldeep

 

 

 

 

Join the discussion
You must log in to join this conversation.