mirror of
https://github.com/release-engineering/dist-git.git
synced 2025-02-23 15:02:54 +00:00
grokmirror support
This commit is contained in:
parent
1ef09b7de8
commit
eb0c75da81
10 changed files with 71 additions and 8 deletions
3
Vagrantfile
vendored
3
Vagrantfile
vendored
|
@ -62,5 +62,8 @@ Vagrant.configure(2) do |config|
|
|||
distgit.vm.provision "shell",
|
||||
inline: "echo 'clime ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers"
|
||||
|
||||
distgit.vm.provision "shell",
|
||||
inline: "dnf install -y python-grokmirror"
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -39,7 +39,7 @@ rlJournalStart
|
|||
rlRun "git push"
|
||||
|
||||
# get srpm file using fedpkg
|
||||
rlRun 'fedpkg --dist f25 srpm'
|
||||
rlRun "fedpkg --dist f25 srpm"
|
||||
|
||||
cd ..
|
||||
|
||||
|
@ -47,11 +47,37 @@ rlJournalStart
|
|||
rlRun "git clone git://pkgs.example.org/prunerepo.git prunerepo-copy"
|
||||
rlRun "git clone http://pkgs.example.org/git/prunerepo prunerepo-copy2"
|
||||
|
||||
# test manifest file update
|
||||
rlRun "wget http://pkgs.example.org/manifest.js.gz"
|
||||
gunzip ./manifest.js.gz
|
||||
rlRun "cat manifest.js | grep prunerepo.git"
|
||||
mv ./manifest.js manifest.js.prev
|
||||
|
||||
# clone repo using fedpkg
|
||||
rlRun "fedpkg clone /var/lib/dist-git/git/prunerepo prunerepo2"
|
||||
|
||||
cd prunerepo2
|
||||
echo "manifest test" > sources
|
||||
|
||||
rlRun "git add -A && git commit -m 'test commit 2'"
|
||||
rlRun "git push"
|
||||
|
||||
cd ..
|
||||
|
||||
rlRun "wget http://pkgs.example.org/manifest.js.gz"
|
||||
gunzip ./manifest.js.gz
|
||||
rlRun "cat manifest.js | grep prunerepo.git"
|
||||
|
||||
modified_prev=`jq '.["/prunerepo.git"].modified' manifest.js.prev`
|
||||
modified=`jq '.["/prunerepo.git"].modified' manifest.js`
|
||||
|
||||
rlAssertGreater "Check that 'modifed' timestamp has been updated in the manifest file" $modified $modified_prev
|
||||
|
||||
cd $CWD
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup BasicTest
|
||||
rm -rf $TESTPATH/prunerepo $TESTPATH/prunerepo-copy* $TESTPATH/prunerepo-1.1.tar.gz
|
||||
rm -rf $TESTPATH/prunerepo $TESTPATH/prunerepo-copy* $TESTPATH/prunerepo2 $TESTPATH/prunerepo-1.1.tar.gz $TESTPATH/manifest*
|
||||
pkgs_cmd 'rm -rf /var/lib/dist-git/git/prunerepo.git'
|
||||
pkgs_cmd 'sudo rm -rf /var/lib/dist-git/cache/lookaside/pkgs/prunerepo'
|
||||
rlPhaseEnd
|
||||
|
|
|
@ -5,3 +5,4 @@ git_author_email = rel-eng@lists.fedoraproject.org
|
|||
cache_dir = /var/lib/dist-git/cache
|
||||
gitroot_dir = /var/lib/dist-git/git
|
||||
gitolite = True
|
||||
grok = True
|
||||
|
|
5
configs/httpd/dist-git/manifest.conf
Normal file
5
configs/httpd/dist-git/manifest.conf
Normal file
|
@ -0,0 +1,5 @@
|
|||
Alias /manifest.js.gz /var/lib/dist-git/git/manifest.js.gz
|
||||
|
||||
<Location /manifest.js.gz>
|
||||
Require all granted
|
||||
</Location>
|
|
@ -29,8 +29,13 @@ Requires: python-configparser
|
|||
Requires: mod_ssl
|
||||
Requires: fedmsg
|
||||
Requires: crudini
|
||||
Requires: moreutils
|
||||
Requires(pre): shadow-utils
|
||||
|
||||
%if 0%{?fedora}
|
||||
Suggests: python-grokmirror
|
||||
%endif
|
||||
|
||||
%description
|
||||
Dist Git is a remote Git repository specifically designed to hold RPM
|
||||
package sources.
|
||||
|
|
4
scripts/dist-git/hooks/grok_update
Executable file
4
scripts/dist-git/hooks/grok_update
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
eval "$(crudini --format=sh --get /etc/dist-git/dist-git.conf dist-git)"
|
||||
/usr/bin/grok-manifest -m $gitroot_dir/manifest.js.gz -t $gitroot_dir -n `pwd`
|
4
scripts/dist-git/hooks/post-receive
Executable file
4
scripts/dist-git/hooks/post-receive
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
# pee redirects stdin to each of the post-receive hooks in place.
|
||||
/usr/bin/pee $GIT_DIR/hooks/post-receive-chained.d/*
|
|
@ -146,6 +146,9 @@ for NAME in $PACKAGES ; do
|
|||
popd >/dev/null
|
||||
exit -2
|
||||
}
|
||||
if [[ $grok && $grok != "False" ]]; then
|
||||
/usr/bin/grok-manifest -m $REPODIR/manifest.js.gz -t $REPODIR -n $REPODIR/$NAME.git
|
||||
fi
|
||||
done
|
||||
|
||||
echo
|
||||
|
|
|
@ -146,6 +146,9 @@ for NAME in $PACKAGES ; do
|
|||
popd >/dev/null
|
||||
exit -2
|
||||
}
|
||||
if [[ $grok && $grok != "False" ]]; then
|
||||
/usr/bin/grok-manifest -m $REPODIR/manifest.js.gz -t $REPODIR -n $REPODIR/$NAME.git
|
||||
fi
|
||||
done
|
||||
|
||||
echo
|
||||
|
|
|
@ -85,6 +85,20 @@ git config --add hooks.mailinglist "$PACKAGE-owner@fedoraproject.org,scm-commits
|
|||
git config --add hooks.maildomain fedoraproject.org
|
||||
popd >/dev/null
|
||||
|
||||
mkdir -p $REPODIR/$PACKAGE.git/hooks/post-receive-chained.d
|
||||
if [[ $grok && $grok != "False" ]]; then
|
||||
if ! [ -f $REPODIR/manifest.js.gz ]; then
|
||||
echo 'Generating initial grok manifest...'
|
||||
/usr/bin/grok-manifest -m $REPODIR/manifest.js.gz -t $REPODIR
|
||||
fi
|
||||
ln -s /usr/share/dist-git/hooks/grok_update \
|
||||
$REPODIR/$PACKAGE.git/hooks/post-receive-chained.d/grok_update
|
||||
fi
|
||||
|
||||
# This one kicks off all the others in post-receive-chained.d
|
||||
ln -s /usr/share/dist-git/hooks/post-receive \
|
||||
$REPODIR/$PACKAGE.git/hooks/post-receive
|
||||
|
||||
# Now clone that repo and create the .gitignore and sources file
|
||||
git init -q $TMPDIR/$PACKAGE
|
||||
pushd $TMPDIR/$PACKAGE >/dev/null
|
||||
|
@ -103,17 +117,12 @@ if [[ $gitolite && $gitolite != "False" ]]; then
|
|||
fi
|
||||
|
||||
# Setup our post-receive hooks
|
||||
mkdir -p $REPODIR/$PACKAGE.git/hooks/post-receive-chained.d
|
||||
ln -s /usr/share/git-core/mail-hooks/gnome-post-receive-email \
|
||||
$REPODIR/$PACKAGE.git/hooks/post-receive-chained.d/post-receive-email
|
||||
ln -s /usr/share/git-core/post-receive-fedmsg \
|
||||
$REPODIR/$PACKAGE.git/hooks/post-receive-chained.d/post-receive-fedmsg
|
||||
ln -s /usr/share/git-core/post-receive-alternativearch \
|
||||
$REPODIR/$PACKAGE.git/hooks/post-receive-chained.d/post-receive-alternativearch
|
||||
|
||||
# This one kicks off all the others in post-receive-chained.d
|
||||
ln -s /usr/share/git-core/post-receive-chained \
|
||||
$REPODIR/$PACKAGE.git/hooks/post-receive
|
||||
|
||||
rm -rf $TMPDIR
|
||||
|
||||
echo "Done."
|
||||
|
|
Loading…
Add table
Reference in a new issue