2 # SPDX-License-Identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2018 The Linux Foundation and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
13 GIT_URL=${GIT_URL:-https://gerrit.opnfv.org/gerrit}
14 STREAM=${STREAM:-'nostream'}
15 RELEASE_FILES=$(git diff HEAD^1 --name-only -- "releases/$STREAM")
17 echo "--> Verifying $RELEASE_FILES."
18 for release_file in $RELEASE_FILES; do
19 # Verify the release file schema
20 python3 releases/scripts/verify_schema.py \
21 -s releases/schema.yaml \
25 for release_file in $RELEASE_FILES; do
26 while read -r repo branch ref; do
27 echo "$repo" "$branch" "$ref"
29 branch_actual="$(git ls-remote "https://gerrit.opnfv.org/gerrit/$repo.git" "refs/heads/$branch" | awk '{print $1}')"
31 if [ -n "$branch_actual" ]; then
32 echo "$repo refs/heads/$branch already exists at $branch_actual"
33 source jjb/releng/releng-release-tagging.sh
35 echo "This is a branching job"
36 source jjb/releng/releng-release-create-branch.sh
39 done < <(python3 releases/scripts/repos.py -b -f "$release_file")