kuldeeppandey
Mission Specialist
Mission Specialist
  • 400 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
  • 353 Views

Re: execute python script using script option in build hook

Jump to solution

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

Reply
Loading...
1 Reply
kuldeeppandey
Mission Specialist
Mission Specialist
  • 354 Views

Re: execute python script using script option in build hook

Jump to solution

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

 

 

 

 

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