Merge "Setup constraints for release"
This commit is contained in:
commit
470a383e93
@ -184,6 +184,69 @@
|
|||||||
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
|
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
|
||||||
$BRANCH_ARG git://git.openstack.org $ZUUL_PROJECT
|
$BRANCH_ARG git://git.openstack.org $ZUUL_PROJECT
|
||||||
|
|
||||||
|
- builder:
|
||||||
|
# Use this macro in the release pipeline to get a tagged repo with
|
||||||
|
# tag checked out and requirements repo with the branch the tag is
|
||||||
|
# on.
|
||||||
|
# The macro also works in other pipelines.
|
||||||
|
name: zuul-release-git-prep-upper-constraints
|
||||||
|
builders:
|
||||||
|
- shell: |
|
||||||
|
#!/bin/bash -xe
|
||||||
|
function get_branch_tag {
|
||||||
|
|
||||||
|
BRANCHES=`git branch -a --contains $ZUUL_REFNAME`
|
||||||
|
|
||||||
|
TARGET_BRANCH=`echo "$BRANCHES"|grep '^ remotes/origin/stable'|cut -d/ -f3-|sort|head -n1`
|
||||||
|
|
||||||
|
if [ -z $TARGET_BRANCH ] ; then
|
||||||
|
TARGET_BRANCH=`echo "$BRANCHES"|grep '^ remotes/origin/'|cut -d/ -f3-|sort|grep -v ^HEAD|head -n1`
|
||||||
|
fi
|
||||||
|
# Nothing found.
|
||||||
|
# Note that zuul-cloner will also fallback to master if
|
||||||
|
# the TARGET_BRANCH does not exist.
|
||||||
|
if [ -z $TARGET_BRANCH ] ; then
|
||||||
|
echo "Tag not found, falling back to master"
|
||||||
|
TARGET_BRANCH=master
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
CLONEMAP=`mktemp`
|
||||||
|
REQS_DIR=`mktemp -d`
|
||||||
|
function cleanup {
|
||||||
|
mkdir -p $WORKSPACE
|
||||||
|
rm -rf $CLONEMAP $REQS_DIR
|
||||||
|
}
|
||||||
|
trap cleanup EXIT
|
||||||
|
cat > $CLONEMAP << EOF
|
||||||
|
clonemap:
|
||||||
|
- name: $ZUUL_PROJECT
|
||||||
|
dest: .
|
||||||
|
EOF
|
||||||
|
|
||||||
|
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
|
||||||
|
git://git.openstack.org $ZUUL_PROJECT
|
||||||
|
|
||||||
|
if [[ "$ZUUL_PROJECT" != "openstack/requirements" ]]; then
|
||||||
|
# Figure out branch for requirements checkout
|
||||||
|
if [[ "$ZUUL_REFNAME" =~ ^refs/tags/ ]] ; then
|
||||||
|
get_branch_tag
|
||||||
|
else
|
||||||
|
TARGET_BRANCH=$ZUUL_REFNAME
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat > $CLONEMAP << EOF
|
||||||
|
clonemap:
|
||||||
|
- name: openstack/requirements
|
||||||
|
dest: $REQS_DIR
|
||||||
|
EOF
|
||||||
|
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
|
||||||
|
--branch $TARGET_BRANCH \
|
||||||
|
git://git.openstack.org openstack/requirements
|
||||||
|
cp $REQS_DIR/upper-constraints.txt ./
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
- builder:
|
- builder:
|
||||||
name: branch-git-prep
|
name: branch-git-prep
|
||||||
builders:
|
builders:
|
||||||
|
@ -560,7 +560,7 @@
|
|||||||
builders:
|
builders:
|
||||||
- print-template-name:
|
- print-template-name:
|
||||||
template-name: "{template-name}"
|
template-name: "{template-name}"
|
||||||
- gerrit-git-prep
|
- zuul-release-git-prep-upper-constraints
|
||||||
- install-distro-packages
|
- install-distro-packages
|
||||||
- revoke-sudo
|
- revoke-sudo
|
||||||
- tarball:
|
- tarball:
|
||||||
|
Loading…
Reference in New Issue
Block a user