File: deploy-nightly.sh

package info (click to toggle)
hackrf 2024.02.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 36,692 kB
  • sloc: ansic: 56,310; xml: 3,424; perl: 2,730; python: 1,427; makefile: 598; asm: 514; vhdl: 319; sh: 179; awk: 20
file content (45 lines) | stat: -rw-r--r-- 1,249 bytes parent folder | download | duplicates (3)
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
#!/bin/bash
PUBLICATION_BRANCH=master
# set -x
cd $HOME
# Checkout the branch
git clone --branch=$PUBLICATION_BRANCH https://${GITHUB_TOKEN}@github.com/${ARTEFACT_REPO}.git publish
cd publish
# Update pages
cp $ARTEFACT_BASE/$BUILD_NAME.tar.xz .
# Write index page
cd $TRAVIS_BUILD_DIR
COMMITS=`git log --oneline | awk '{print $1}'`
cd $HOME/publish
echo "
<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
<html><head>
	<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">
	<title>HackRF Nightly Builds</title>
</head>
<body>
<h2>HackRF Nightly Builds</h2>
" > index.html

for commit in $COMMITS; do
    FILENAME=`find . -maxdepth 1  -name "*-$commit.tar.xz"`
    if [ "$FILENAME" != "" ]; then
        FN=${FILENAME:2}
        echo "<a href=\"${ARTEFACT_URL}/$FN\">$FN</a><br />" >> index.html
    fi
    
done

echo "
</body></html>
" >> index.html

# Commit and push latest version
git add $BUILD_NAME.tar.xz index.html
git config user.name  "Travis"
git config user.email "travis@travis-ci.org"
git commit -m "Build products for $SHORT_COMMIT_HASH, built on $TRAVIS_OS_NAME, log: $TRAVIS_BUILD_WEB_URL"
if [ "$?" != "0" ]; then
    echo "Looks like the commit failed"
fi
git push -fq origin $PUBLICATION_BRANCH