[OpenStack-Infra] git checkout $ZUUL_NEWREV error reference is not a tree

Fayyaz rehman fayyaz.rehman at corvit.com
Mon Jul 13 11:27:24 UTC 2015


Sorry for the delayed reply. well this reference is present on the zuul git
repository side.

when running publish-doc job. zuul is not fetching all the references from
the zuul git repository present on CI vm into the
workspace/examp_publish-doc on the Jenkins-slave vm.

used gerrit-git-prep.sh and example-publis-doc.yaml

#!/bin/bash -e

GERRIT_SITE=$1
GIT_ORIGIN=$2

if [ -z "$GERRIT_SITE" ]; then
    echo "The gerrit site name (eg 'https://review.openstack.org') must be
the first argument."
    exit 1
fi

if [ -z "$ZUUL_URL" ]; then
    echo "The ZUUL_URL must be provided."
    exit 1
fi

if [ -z "$ZUUL_REF" ]; then
    if [ -n "$BRANCH" ]; then
        echo "No ZUUL_REF so using requested branch $BRANCH from origin."
        ZUUL_REF=$BRANCH
        # use the origin since zuul mergers have outdated branches
        ZUUL_URL=$GIT_ORIGIN
    else
        echo "Provide either ZUUL_REF or BRANCH in the calling enviromnent."
        exit 1
    fi
fi

if [ ! -z "$ZUUL_CHANGE" ]; then
    echo "Triggered by: $GERRIT_SITE/$ZUUL_CHANGE"
fi

set -x
if [[ ! -e .git ]]; then
    ls -a
    rm -fr .[^.]* *
    if [ -d /opt/git/$ZUUL_PROJECT/.git ]; then
        git clone file:///opt/git/$ZUUL_PROJECT .
    else
        git clone $GIT_ORIGIN/$ZUUL_PROJECT .
    fi
fi
git remote set-url origin $GIT_ORIGIN/$ZUUL_PROJECT

# attempt to work around bugs 925790 and 1229352
if ! git remote update; then
    echo "The remote update failed, so garbage collecting before trying
again."
    git gc
    git remote update
fi

git reset --hard
if ! git clean -x -f -d -q ; then
    sleep 1
    git clean -x -f -d -q
fi

if echo "$ZUUL_REF" | grep -q ^refs/tags/; then
    git fetch --tags $ZUUL_URL/$ZUUL_PROJECT
    git checkout $ZUUL_REF
    git reset --hard $ZUUL_REF
elif [ -z "$ZUUL_NEWREV" ]; then
    git fetch $ZUUL_URL/$ZUUL_PROJECT $ZUUL_REF
    git checkout FETCH_HEAD
    git reset --hard FETCH_HEAD
else
    git checkout $ZUUL_NEWREV
    git reset --hard $ZUUL_NEWREV
fi

if ! git clean -x -f -d -q ; then
    sleep 1
    git clean -x -f -d -q
fi

if [ -f .gitmodules ]; then
    git submodule init
    git submodule sync
    git submodule update --init
fi
=====

- job:
    name: example-publish-doc
    project-type: freestyle
    defaults: global
    description: 'Do not edit this job through the web!'
    disabled: false
    display-name: 'example-publish-doc'
    concurrent: true
    quiet-period: 5
    block-downstream: false
    block-upstream: false
    retry-count: 3
    node: slave1
    logrotate:
      daysToKeep: 3
      numToKeep: 20
      artifactDaysToKeep: -1
      artifactNumToKeep: -1
    properties:
      - inject:
          keep-build-variables: true
          keep-system-variables: true
    builders:
      - shell: |
          #!/bin/bash -xe
          env
          /home/corvit/slave_scripts/gerrit-git-prep.sh
https://ci.corvit.lab/gerrit ci.corvit.lab:/git
          /home/corvit/slave_scripts/run-doc.sh
          cd doc; make latexpdf
          cd ..
          /usr/bin/ssh ci.corvit.lab 'sudo rm -rf /home/corvit/doc/example
/var/www/html/example'
          /usr/bin/ssh ci.corvit.lab 'mkdir -p /home/corvit/doc/example'
          /usr/bin/scp -r doc/build ci.corvit.lab:/home/corvit/doc/example
          /usr/bin/ssh ci.corvit.lab 'mv
/home/corvit/doc/example/build/html /home/corvit/doc/example/build/example'
          /usr/bin/ssh ci.corvit.lab 'mv
/home/corvit/doc/example/build/latex
/home/corvit/doc/example/build/example/'
          /usr/bin/ssh ci.corvit.lab 'sudo mv
/home/corvit/doc/example/build/example /var/www/html/'
          /bin/echo 'Documentation at https://ci.corvit.lab/example/'
          /bin/echo 'API documentation at
https://ci.corvit.lab/example/apidoc.html'
          /bin/echo 'PDF documentation at
https://ci.corvit.lab/example/latex/'




Best Regards,

Fayyaz Ur Rehman,


Corvit Technologies
14-D/1, Ghalib Road, Gulberg III, Lahore, Pakistan.
UAN: +92-42-111-CORVIT
Tel: +92-42-5717271-2(Ext: 129)
Cell: +92-321-4184438

On Tue, Jul 7, 2015 at 2:03 AM, Jeremy Stanley <fungi at yuggoth.org> wrote:

> On 2015-07-06 10:48:24 +0500 (+0500), Fayyaz rehman wrote:
> [...]
> > + git checkout 5bc04e0127315bc0107cac27ce00424da965b685
> > fatal: reference is not a tree: 5bc04e0127315bc0107cac27ce00424da965b685
> > Build step 'Execute shell' marked build as failure
> >
> > If somebody has any idea why i am facing this error. Please eloborate
>
> That's the error git gives you when you try to checkout a
> nonexistent reference. Are you sure that ref is relevant to the
> repository in question?
> --
> Jeremy Stanley
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-infra/attachments/20150713/cf244511/attachment.html>


More information about the OpenStack-Infra mailing list