Code Review
/
releng
/
builder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Create macro to update validate AR projects
[releng/builder.git]
/
jjb
/
autorelease
/
update-validate-autorelease-projects.sh
diff --git
a/jjb/autorelease/update-validate-autorelease-projects.sh
b/jjb/autorelease/update-validate-autorelease-projects.sh
index db7a9f16728d468984940aab183abd79e549981f..327fb1abfd45925cb390f4c7a85b7c7a2d066c20 100644
(file)
--- a/
jjb/autorelease/update-validate-autorelease-projects.sh
+++ b/
jjb/autorelease/update-validate-autorelease-projects.sh
@@
-1,7
+1,7
@@
#!/bin/bash
# SPDX-License-Identifier: EPL-1.0
##############################################################################
#!/bin/bash
# SPDX-License-Identifier: EPL-1.0
##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
+# Copyright (c) 2017
- 2018
The Linux Foundation and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
@@
-14,12
+14,15
@@
BRANCH="stable/${STREAM}"
# The current development release will not have a stable branch defined so if
# branch does not exist assume master
# The current development release will not have a stable branch defined so if
# branch does not exist assume master
-wget --no-verbose -O /tmp/ar-branches.json https://git.opendaylight.org/gerrit/projects/releng%2Fautorelease/branches/
-if ! grep "$BRANCH" /tmp/ar-branches.json; then
- BRANCH=master
+url="https://git.opendaylight.org/gerrit/projects/releng%2Fautorelease/branches/"
+resp=$(curl -s -w "\\n\\n%{http_code}" --globoff -H "Content-Type:application/json" "$url")
+if [[ ! "$resp" =~ $BRANCH ]]; then
+ BRANCH="master"
fi
fi
-wget --no-verbose -O /tmp/pom.xml "https://git.opendaylight.org/gerrit/gitweb?p=releng/autorelease.git;a=blob_plain;f=pom.xml;hb=$GERRIT_BRANCH"
+wget -nv -O /tmp/pom.xml "https://git.opendaylight.org/gerrit/gitweb?p=releng/autorelease.git;a=blob_plain;f=pom.xml;hb=$GERRIT_BRANCH"
+# Allow word splitting as we only expect modules to appear
+# shellcheck disable=2207
modules=($(xmlstarlet sel -N x=http://maven.apache.org/POM/4.0.0 -t -m '//x:modules' -v '//x:module' /tmp/pom.xml))
cat > "$YAML_FILE" << EOF
modules=($(xmlstarlet sel -N x=http://maven.apache.org/POM/4.0.0 -t -m '//x:modules' -v '//x:module' /tmp/pom.xml))
cat > "$YAML_FILE" << EOF