2015-09-22 21:51:16 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
[ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ] && {
|
|
|
|
# Setup everything
|
|
|
|
sudo apt-get update &>/dev/null
|
|
|
|
sudo apt-get install reprepro gnupg expect tree -y >/dev/null
|
|
|
|
|
|
|
|
gpg --import s.key
|
|
|
|
mkdir temp
|
|
|
|
temp="$PWD/temp"
|
2015-09-23 10:56:11 +02:00
|
|
|
|
2015-09-23 12:05:58 +02:00
|
|
|
reprepro="$PWD/ex"
|
2015-09-22 21:51:16 +02:00
|
|
|
chmod +x ${reprepro}
|
|
|
|
|
|
|
|
gitsync() {
|
|
|
|
branch="${1}"
|
|
|
|
shift
|
|
|
|
[ "${branch}" != "master" ] && {
|
|
|
|
echo "branches:
|
|
|
|
except:
|
|
|
|
- ${branch}" > .travis.yml
|
|
|
|
echo "vendor
|
|
|
|
s.key" >.gitignore
|
|
|
|
}
|
|
|
|
git add -A
|
|
|
|
git commit -am "${*}"
|
|
|
|
git push -fq origin ${branch}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
git clone https://${GH_TOKEN}@github.com/danog/repo.git
|
|
|
|
cd repo
|
|
|
|
git config --global user.name "${GIT_NAME}"
|
|
|
|
git config --global user.email "${GIT_EMAIL}"
|
|
|
|
git config --global push.default simple
|
|
|
|
git log -1 --pretty=%B | grep -q madebytravisci && exit 0
|
|
|
|
root="$PWD"
|
|
|
|
########################################
|
|
|
|
cd reprepro
|
|
|
|
ls $root/debs | grep -q '\.deb' && {
|
|
|
|
# Import debs into reprepro
|
|
|
|
|
|
|
|
for f in $root/debs/*.deb; do
|
|
|
|
name="$(dpkg --info ${f} | grep Package | sed 's/.*Package:\s//')"
|
|
|
|
${reprepro} remove lenny ${name} && ${reprepro} includedeb lenny ${f} && rm $f
|
|
|
|
total="${total}, ${name}"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
tree -T "Daniil's repo" -C -H http://repo.daniil.it -o tree.html
|
|
|
|
cp -a * $temp
|
|
|
|
|
|
|
|
# Generate website
|
|
|
|
cd $root/jekyll
|
|
|
|
echo "---
|
|
|
|
layout: default
|
|
|
|
---
|
|
|
|
">index.md
|
|
|
|
cat ../README.md >> index.md
|
|
|
|
cp -a * $temp
|
|
|
|
cd $root
|
|
|
|
|
|
|
|
gitsync master OK madebytravisci
|
|
|
|
|
|
|
|
# Upload everything
|
|
|
|
git branch -d gh-pages
|
|
|
|
git checkout --orphan gh-pages
|
|
|
|
git rm -rf .
|
|
|
|
cp -a $temp/* .
|
|
|
|
gitsync gh-pages "Added/updated ${total}"
|
|
|
|
|
|
|
|
}
|