aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorbartus2019-09-19 15:15:30 +0200
committerbartus2019-09-24 14:40:20 +0200
commit606f2f6699d494c5127bc52f07d2e009bb5c6439 (patch)
treef93a4065ba9a2c23e315aa9e372a9f27a56c9b92
parent257fd3859327bb85fbf0c2ec3230b1e8109d9950 (diff)
downloadaur-606f2f6699d494c5127bc52f07d2e009bb5c6439.tar.gz
Travis: add update.PKGBUILD
* run ./update.PKGBUILD in arch:script * test if dependencies version changed ** commit and push to aur and github.
-rw-r--r--.travis.yml32
-rw-r--r--aur4travis.encbin0 -> 2608 bytes
-rw-r--r--github4travis.encbin0 -> 2608 bytes
3 files changed, 31 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
index 58119bb4742e..3e863baab57b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -20,11 +20,13 @@ arch:
- ~/.ccache:~/.ccache
- ~/.cache/yay:~/.cache/yay
- ~/.pkg-cache:/var/cache/pacman/pkg
+ - ~/.ssh:~/.ssh
repos:
# - bartus=https://github.com/bartoszek/AUR-repo/raw/master
packages:
- ccache
- moreutils
+ - openssh
before_install:
# 1.Override `package-cleanup.hook` to preserve cache for travis.
# 2.Enable ccache
@@ -48,11 +50,39 @@ arch:
- unset CC CXX
- yay -S --noconfirm gegl-git
- unset CC CXX
- - timeout 40m makepkg -s --noconfirm | ts -s '[%.T]'; _makepkg_return=${PIPESTATUS[0]}
+ - timeout 40m makepkg -s --noconfirm > >(ts -s '[%.T]'); _makepkg_return=$?
+# Update PKGBUILD and push changes to AUR
+ - ./update.PKGBUILD
+ - |
+ deps_update=$(git diff .SRCINFO|grep -oP "^\+\tdepends = \K.*") && [[ "$TRAVIS_EVENT_TYPE" =~ "push|cron" ]] && \
+ ( . PKGBUILD
+ git checkout master
+ git config user.name "Travis"
+ git config user.email "travis@example.org"
+ git remote add aur ssh://aur@aur.archlinux.org/${pkgname}-git
+ git remote add github git@github.com:bartoszek/AUR-${pkgname}.git
+ echo "\$ git config"
+ git config -l
+ git commit -a -m "Update denepdencies" -m "$deps_update" -m "[skip ci]"
+ echo "\$ stat ~/.ssh/*"
+ stat ~/.ssh/*
+ echo "\$ git push"
+ git push aur
+ git push github
+ ) || true
+# Clean
- sudo pacman -Sc --noconfirm
- ccache -s
- exit $_makepkg_return
script:
+# decrypt aur and github ssh key
+- openssl aes-256-cbc -K $encrypted_1a5ecd398a03_key -iv $encrypted_1a5ecd398a03_iv -in aur4travis.enc -out ~/.ssh/aur4travis -d
+- openssl aes-256-cbc -K $encrypted_9b4b6471bd69_key -iv $encrypted_9b4b6471bd69_iv -in github4travis.enc -out ~/.ssh/github4travis -d
+# add ssh keys to ssh_config(5) (ssh key and ssh_config has to have specific/restrictive permissions)
+- echo -e "Host aur.archlinux.org\n\tUser aur\n\tIdentityFile ~/.ssh/aur4travis\n" >> ~/.ssh/config
+- echo -e "Host github.com \n\tUser git\n\tIdentityFile ~/.ssh/github4travis\n" >> ~/.ssh/config
+- chmod 600 ~/.ssh/*
+# scripts containing ':' has to come in double quotes.
- "curl -s https://raw.githubusercontent.com/bartoszek/arch-travis/base64-encode/arch-travis.sh| bash"
- "echo pacman pkg cache size: $(du -h ~/.pkg-cache|cut -f1) in $(ls ~/.pkg-cache|wc -l) files"
diff --git a/aur4travis.enc b/aur4travis.enc
new file mode 100644
index 000000000000..4912ef52e42d
--- /dev/null
+++ b/aur4travis.enc
Binary files differ
diff --git a/github4travis.enc b/github4travis.enc
new file mode 100644
index 000000000000..423a341c984f
--- /dev/null
+++ b/github4travis.enc
Binary files differ