how to edit jenkins job configuration

To modify the jenkins config you do not need to edit it manualy on jenkins web application.

To download the config you should go to the job config history and downalod the newest one.

There are other options:
1. easy one

user@host:/opt/cpp/jenkins_home/jobs/Test-my-branch$ pwd
/opt/jenkins_home/jobs/Test-my-branch
user@host:/opt/jenkins_home/jobs/Test-my-branch$ vim config.xml

and do what you need 🙂

2. not so easy

prepare config.xml file

wget –auth-no-challenge –user=joe.shmoe –password=secret  –post-file=config.xml –no-check-certificate  https://jenkins.company.com/job/myProject/config.xml

or

curl “http://localhost:18080/jenkins/job/npm-package-aaa/config.xml ” -si –data-binary “$XML” -H “Content-Type: text/xml”

 

Advertisements

awk vs cut

How to parse the string and get elements form it

input string: foo_20130612_15_25_46_bar01_02

expected output: 20130612

echo “foo_20130612_15_25_46_bar01_02” | awk -F’_’ ‘{print $2}’

echo “foo_20130612_15_25_46_bar01_02” | cut -d’_’ -f2