summaryrefslogtreecommitdiffstats
path: root/qa/workunits/fs/snaps/snaptest-git-ceph.sh
blob: 12c1f0fdc0036ac86ec85d9a0d05711586243a89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh -x

set -e

# try it again if the clone is slow and the second time
retried=false
trap -- 'retry' EXIT
retry() {
    rm -rf ceph
    # double the timeout value
    timeout 3600 git clone https://git.ceph.com/ceph.git
}
rm -rf ceph
timeout 1800 git clone https://git.ceph.com/ceph.git
trap - EXIT
cd ceph

versions=`seq 1 90`

for v in $versions
do
    if [ $v -eq 48 ]; then
        continue
    fi
    ver="v0.$v"
    echo $ver
    git reset --hard $ver
    mkdir .snap/$ver
done

for v in $versions
do
    if [ $v -eq 48 ]; then
        continue
    fi
    ver="v0.$v"
    echo checking $ver
    cd .snap/$ver
    git diff --exit-code
    cd ../..
done

for v in $versions
do
    if [ $v -eq 48 ]; then
        continue
    fi
    ver="v0.$v"
    rmdir .snap/$ver
done

echo OK