-
Notifications
You must be signed in to change notification settings - Fork 8
/
generate_manifest.sh
42 lines (34 loc) · 1.25 KB
/
generate_manifest.sh
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
#!/bin/bash
set -ex
#docker run -t --rm -e "REAL_GIT_BRANCH=master" -v $(pwd):/work -w /work smashwilson/curl /bin/bash generate_manifest.sh
if [ "$REAL_GIT_BRANCH" = "master" ]
then
TEMPDIR=`mktemp -d`
if [ -f manifest ]; then
rm manifest
fi
#for each line in the nightly-repos folder
#get the latest file from the repo
curl -o ${TEMPDIR}/nightlies.xml http://openrov-software-nightlies.s3-us-west-2.amazonaws.com
ls ${TEMPDIR}/nightlies.xml
while read package; do
#need to parse package name and prefix out of nightlies
S3prefix=$( echo "$package" | cut -d= -f2)
echo "Prefix ${S3prefix}"
# cat ${TEMPDIR}/nightlies.xml | ./getLatestFileFromS3.sh ${package}
cat ${TEMPDIR}/nightlies.xml | ./getLatestFileFromS3.sh "${S3prefix}" >> ${TEMPDIR}/latest_files.txt
done < nightly-repos
cat ${TEMPDIR}/latest_files.txt
#get the list of dependent files
while read item; do
echo $item | awk -F'[_/]' '{print $(NF-2) " " $(NF-1)}' >> manifest
done < ${TEMPDIR}/latest_files.txt
rm -rf $TEMPDIR
echo 'Manifest:'
echo manifest
echo '--End Manifest--'
else
# When branching from development, you must also create a new manifest_release to lock the dependency versions
cp manifest_release manifest
fi
cat manifest