diff options
author | Gary Wu <gary.i.wu@huawei.com> | 2017-06-16 13:44:28 -0700 |
---|---|---|
committer | Gary Wu <gary.i.wu@huawei.com> | 2017-06-16 13:44:28 -0700 |
commit | 213a8351fd266294e17a862b4d223c1968800a09 (patch) | |
tree | 0eaa87c3253da9f65fcbaf514c6b2baaf06fa162 /bootstrap/jenkins/scripts | |
parent | 06a50674c025c198585a6de4e6bb035cde63832d (diff) |
Added vagrant setup for a Jenkins system for ONAP
Add a set of vagrant scripts that will set up a
local Jenkins environment with pre-defined jobs
to build all the ONAP java code and docker images.
Change-Id: I67ed254bcb38a7be989b7c2861fd3ea4ec9c66f2
Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'bootstrap/jenkins/scripts')
-rwxr-xr-x | bootstrap/jenkins/scripts/clone-all.sh | 5 | ||||
-rwxr-xr-x | bootstrap/jenkins/scripts/gen-java-jobs.py | 27 | ||||
-rwxr-xr-x | bootstrap/jenkins/scripts/ls-projects.sh | 2 | ||||
-rwxr-xr-x | bootstrap/jenkins/scripts/ls-top-poms.sh | 2 | ||||
-rwxr-xr-x | bootstrap/jenkins/scripts/pull-all.sh | 8 |
5 files changed, 44 insertions, 0 deletions
diff --git a/bootstrap/jenkins/scripts/clone-all.sh b/bootstrap/jenkins/scripts/clone-all.sh new file mode 100755 index 000000000..6bdb68a09 --- /dev/null +++ b/bootstrap/jenkins/scripts/clone-all.sh @@ -0,0 +1,5 @@ +#!/bin/sh +while read p; do + echo $p + git clone ssh://gerrit.onap.org:29418/$p $p +done < projects.txt diff --git a/bootstrap/jenkins/scripts/gen-java-jobs.py b/bootstrap/jenkins/scripts/gen-java-jobs.py new file mode 100755 index 000000000..0da988083 --- /dev/null +++ b/bootstrap/jenkins/scripts/gen-java-jobs.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +import fileinput +import os +import subprocess + +print """- project: + name: onap-java + jobs: + - 'java-{project}' + project:""" + +for line in fileinput.input(): + repo = line.strip() + isGroupRepo = subprocess.call("grep -s 'Group repo' {}/README.md > /dev/null".format(repo), shell=True) == 0 + if not isGroupRepo: + pompaths = os.popen("./ls-top-poms.sh {}".format(repo)).readlines() + for pompath in pompaths: + pompath = pompath.strip() + project = repo.replace("/", "_") + if pompath: + project += "_" + pompath.replace("/", "_") + print " - '{}':".format(project) + print " repo: '{}'".format(repo) + if pompath: + print " pom: '{}/pom.xml'".format(pompath) + else: + print " pom: 'pom.xml'" diff --git a/bootstrap/jenkins/scripts/ls-projects.sh b/bootstrap/jenkins/scripts/ls-projects.sh new file mode 100755 index 000000000..17b8c7893 --- /dev/null +++ b/bootstrap/jenkins/scripts/ls-projects.sh @@ -0,0 +1,2 @@ +#!/bin/sh +ssh -p 29418 gerrit.onap.org gerrit ls-projects | grep -v All diff --git a/bootstrap/jenkins/scripts/ls-top-poms.sh b/bootstrap/jenkins/scripts/ls-top-poms.sh new file mode 100755 index 000000000..e856ee977 --- /dev/null +++ b/bootstrap/jenkins/scripts/ls-top-poms.sh @@ -0,0 +1,2 @@ +#!/bin/sh +find $1 -mindepth 0 -type d -exec test -e "{}/pom.xml" ';' -prune -printf "%P\n" | sort diff --git a/bootstrap/jenkins/scripts/pull-all.sh b/bootstrap/jenkins/scripts/pull-all.sh new file mode 100755 index 000000000..cf6655ce7 --- /dev/null +++ b/bootstrap/jenkins/scripts/pull-all.sh @@ -0,0 +1,8 @@ +#!/bin/sh +while read p; do + echo $p + cd ~/Projects/onap/$p + git fetch + git reset --hard origin + git clean -f -d -x +done < projects.txt |