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
|
2016-02-17 17:03:55 +01:00
|
|
|
sudo apt-get install reprepro gnupg expect tree tmux -y >/dev/null
|
2016-02-20 16:21:46 +01:00
|
|
|
reprepro=reprepro
|
|
|
|
gpg --allow-secret-key-import --import key.gpg
|
2015-09-22 21:51:16 +02:00
|
|
|
mkdir temp
|
|
|
|
temp="$PWD/temp"
|
2015-09-23 10:56:11 +02:00
|
|
|
|
2016-02-20 16:21:46 +01:00
|
|
|
echo "batch
|
|
|
|
yes
|
|
|
|
passphrase $p
|
|
|
|
">>~/.gnupg/gpg.conf
|
2015-09-22 21:51:16 +02:00
|
|
|
|
|
|
|
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
|
2016-02-20 16:21:46 +01:00
|
|
|
[ "$(ls $root/debs)" != "" ] && {
|
|
|
|
# Import debs into reprepro
|
|
|
|
|
|
|
|
for f in $root/debs/*; do {
|
|
|
|
deb="$(ls $f/*.deb)"
|
|
|
|
changes="$(ls $f/*.changes)"
|
|
|
|
dsc="$(ls $f/*.dsc)"
|
|
|
|
|
|
|
|
name="$(dpkg --info ${deb} | grep Package | sed 's/.*Package:\s//')"
|
|
|
|
${reprepro} remove lenny ${name}
|
|
|
|
|
|
|
|
[ "$changes" != "" ] && {
|
|
|
|
reprepro include lenny ${changes} && rm -r $f
|
|
|
|
} || {
|
|
|
|
${reprepro} includedeb lenny ${deb} && ${reprepro} includedsc lenny ${dsc} && rm -r $f
|
|
|
|
}
|
|
|
|
total="${total}, ${name}"
|
|
|
|
rm -r $f
|
|
|
|
}; done
|
|
|
|
}
|
2015-09-22 21:51:16 +02:00
|
|
|
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/* .
|
2015-10-20 20:40:24 +02:00
|
|
|
cp -a dists/lenny/main/binary-iphoneos-arm/* .
|
2015-09-22 21:51:16 +02:00
|
|
|
gitsync gh-pages "Added/updated ${total}"
|
|
|
|
|
|
|
|
}
|