summaryrefslogtreecommitdiffstats
path: root/jjb/releng
diff options
context:
space:
mode:
authorAric Gardner <agardner@linuxfoundation.org>2018-09-12 14:12:51 -0400
committerTrevor Bramwell <tbramwell@linuxfoundation.org>2018-09-18 15:47:17 -0700
commitc0c6f23c2c494cefa01398f6c18e95af4c801d1a (patch)
treea4bb9d5684146dc4151442ccc6b2c5adfcf533c4 /jjb/releng
parent0ee36b71b34afa6f54415a8ed7bcd25222591a4e (diff)
Create branches via ssh rather than the https
Previously we created the branches over Gerrit's HTTPS interface. One or two projects from the previous release did not have their stable branches created at the correct place. Switch to using ssh for branch creation will be more reliable and easier for us to verify. Change-Id: If7f24d2b19e74513b59889bd64d25919aa048e4c Signed-off-by: Aric Gardner <agardner@linuxfoundation.org> Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Diffstat (limited to 'jjb/releng')
-rw-r--r--jjb/releng/releng-release-create-branch.sh15
-rw-r--r--jjb/releng/releng-release-jobs.yaml2
2 files changed, 15 insertions, 2 deletions
diff --git a/jjb/releng/releng-release-create-branch.sh b/jjb/releng/releng-release-create-branch.sh
index 92be0e637..663ff19e7 100644
--- a/jjb/releng/releng-release-create-branch.sh
+++ b/jjb/releng/releng-release-create-branch.sh
@@ -26,7 +26,20 @@ STREAM=${STREAM:-'nostream'}
RELEASE_FILES=$(git diff HEAD^1 --name-only -- "releases/$STREAM")
for release_file in $RELEASE_FILES; do
- python releases/scripts/create_branch.py -f $release_file
+
+ while read -r repo branch ref; do
+
+ echo "$repo" "$branch" "$ref"
+ branches="$(git ls-remote "https://gerrit.opnfv.org/gerrit/$repo.git" "refs/heads/$branch")"
+
+ if ! [ -z "$branches" ]; then
+ echo "refs/heads/$branch already exists at $ref ($branches)"
+ else
+ ssh -n -f -p 29418 gerrit.opnfv.org gerrit create-branch "$repo" "$branch" "$ref"
+ fi
+
+ done < <(python releases/scripts/repos.py -b -f "$release_file")
+
python releases/scripts/create_jobs.py -f $release_file
NEW_FILES=$(git status --porcelain --untracked=no | cut -c4-)
if [ -n "$NEW_FILES" ]; then
diff --git a/jjb/releng/releng-release-jobs.yaml b/jjb/releng/releng-release-jobs.yaml
index 89519ae9b..3136d7855 100644
--- a/jjb/releng/releng-release-jobs.yaml
+++ b/jjb/releng/releng-release-jobs.yaml
@@ -107,7 +107,7 @@
- shell: !include-raw-escape:
- releng-release-create-venv.sh
- releng-release-tagging.sh
- # - releng-release-create-branch.sh
+ - releng-release-create-branch.sh
publishers:
- email-jenkins-admins-on-failure