-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconvert
executable file
·94 lines (82 loc) · 2.24 KB
/
convert
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/sh
# convert LAVA-CI jobs to be hosted on lava-healtchek
NOACT=0
if [ "$1" = '-n' ];then
NOACT=1
fi
if [ -z "$1" ];then
echo "Usage: $0 job to convert"
exit 1
fi
if [ ! -e "$1" ];then
echo "Cannot find $1"
exit 1
fi
if [ ! -e ../lava-healthchecks-binary ];then
echo "lava-healthchecks-binary must be checkouted on the same parent directory than lava-healthchecks"
exit 1
fi
BASEPATH=$(dirname $0)
convert_agl() {
grep download.automotivelinux.org $1 |grep -iE 'url' |\
grep -v '/$' |\
sed 's,^.*http,http,' |\
sort | uniq |
while read line
do
echo "DEBUG: $line"
IPATH=$(dirname $line | sed 's,^https://[a-z0-9\.]*/,,')
echo "IPATH is $IPATH"
mkdir -pv ../lava-healthchecks-binary/$BASEPATH/$IPATH
OLDPATH=$(pwd)
cd ../lava-healthchecks-binary/$BASEPATH/$IPATH
wget -N $line
cd $OLDPATH
sed -i 's,download.automotivelinux.org,github.com/montjoie/lava-healthchecks-binary/blob/master,' $1
done
}
grep storage.kernelci.org $1 |grep -iE 'url' |\
grep -v '/$' |\
sed 's,^.*http,http,' |\
sort | uniq |
while read line
do
OLDPATH=$(pwd)
IPATH=$(dirname $line | sed 's,^http[s]*://[a-z0-9\.]*/,,')
echo "HANDLE: $IPATH"
if [ $NOACT -eq 1 ];then
echo "DEBUG: will create ../lava-healthchecks-binary/$BASEPATH/$IPATH"
echo "DEBUG: wget $line"
else
mkdir -pv ../lava-healthchecks-binary/$BASEPATH/$IPATH
cd ../lava-healthchecks-binary/$BASEPATH/$IPATH
wget -N $line
fi
cd $OLDPATH
done
convert() {
grep github.com/montjoie $1 |grep -iE 'url' |\
grep -v '/$' |\
sed 's,^.*http,http,' |\
sed 's,https://github.com/montjoie/lava-healthchecks-binary/blob/master/,https://storage.kernelci.org/,' |\
sed 's,?raw=true,,' |\
sort | uniq |
while read line
do
IPATH=$(dirname $line | sed 's,^https://[a-z0-9\.]*/,,')
echo "IPATH is $IPATH"
mkdir -pv ../lava-healthchecks-binary/$BASEPATH/$IPATH
OLDPATH=$(pwd)
cd ../lava-healthchecks-binary/$BASEPATH/$IPATH
wget -N $line
cd $OLDPATH
done
}
if [ $NOACT -eq 0 ];then
sed -i 's,storage.kernelci.org,github.com/montjoie/lava-healthchecks-binary/blob/master,' $1
sed -i 's,rootfs.cpio.gz$,rootfs.cpio.gz?raw=true,' $1
sed -i 's,dtb$,dtb?raw=true,' $1
sed -i 's,Image$,Image?raw=true,' $1
sed -i 's,modules.tar.xz$,modules.tar.xz?raw=true,' $1
sed -i 's,http://github.com,https://github.com,' $1
fi