Skip to content

Instantly share code, notes, and snippets.

@shrkw
Created July 3, 2013 09:33
Show Gist options
  • Save shrkw/5916656 to your computer and use it in GitHub Desktop.
Save shrkw/5916656 to your computer and use it in GitHub Desktop.
Manually editing Jenkins config xml
#!/bin/bash
IFS='
'
i=1
for l in `grep -n '<hudson.triggers.SCMTrigger>' /disk1/jenkins/jobs/*/config.xml`
#for l in `head -1 /tmp/src`
do
n=`echo $l | cut -d':' -f2`
f=`echo $l | cut -d':' -f1`
echo 'a ' $i ': ' $n $f
echo "$n,$((n+3))d"
cp $f config.xml.$i
sudo sed -i "$n,$((n+3))d" $f
i=$((i+1))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment