Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 66fbb83

Browse files
author
Eric Berryman
committed
adding script build/triggerJenkinsJob.sh
1 parent 10d51b0 commit 66fbb83

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

build/triggerJenkinsJob.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
set -e
3+
set +x
4+
5+
export token
6+
7+
while IFS='' read -r line || [[ -n "$line" ]]; do
8+
token=$line
9+
done < "$1"
10+
11+
folderChangeSet=(`git diff-tree --name-only --no-commit-id -r HEAD | grep '\(core\|applications\)\/[[:alpha:]]' | cut -d/ -f1,2`)
12+
sorted_unique=(`echo "${folderChangeSet[@]}" | tr ' ' '\n' | sort -u -r | tr '\n' ' '`)
13+
14+
for project in "${sorted_unique[@]}"
15+
do
16+
arr=(${project//// })
17+
jenkinsName="cs-studio-${arr[0]}-${arr[1]}-${GIT_BRANCH#*/}"
18+
echo "triggering ${jenkinsName}"
19+
curl -X POST https://openepics.ci.cloudbees.com/job/${jenkinsName}/build --data token=${token}
20+
done
21+
22+
set -x
23+

0 commit comments

Comments
 (0)