Jump to content


change-commit in Python


  • Please log in to reply
1 reply to this topic

#1 GrahamL

GrahamL

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 17 August 2020 - 01:33 PM

Hi
I came across this script to kick off a Jenkins build, but I wanted to implement it in Python  but cannot find any resources.
Please can someone get me started

Thanks

#!/bin/bash
CHANGE=$1

P4PORT=perforce:1666
JUSER=admin
JPASS=pass
JSERVER=http://localhost:8080

curl --header 'Content-Type: application/json' \
     --request POST \
     --silent \
     --user $JUSER:$JPASS \
     --data payload="{change:$CHANGE,p4port:\"$P4PORT\"}" \
     $JSERVER/p4/change

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1191 posts

Posted 17 August 2020 - 02:39 PM

Python's official docs are pretty good: https://www.python.o...gettingstarted/

IMO if you have a working script (especially a relatively simple one like this) there's no particular reason to port it to a different language, especially one you aren't already familiar with.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users