From 8389d9659d3b0fca075604b9359f82e224807761 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Tue, 14 Mar 2017 10:48:58 +0100 Subject: [PATCH] Add initial .travis.yml --- .travis.yml | 25 +++++++++++++++++++++++++ update.sh | 10 ++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..e8e5b113 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,25 @@ +language: bash +services: docker + +env: + - VERSION=11.0 VARIANT=fpm + - VERSION=11.0 VARIANT=apache + - VERSION=10.0 VARIANT=fpm + - VERSION=10.0 VARIANT=apache + - VERSION=9.0 VARIANT=fpm + - VERSION=9.0 VARIANT=apache + +install: + - git clone https://github.com/docker-library/official-images.git ~/official-images + +before_script: + - env | sort + - cd "$VERSION" + - image="nextcloud:${VERSION}${VARIANT:+-$VARIANT}" + +script: + - travis_retry docker build -t "$image" "${VARIANT}" + - ~/official-images/test/run.sh "$image" + +after_script: + - docker images diff --git a/update.sh b/update.sh index d185f635..4c41d755 100755 --- a/update.sh +++ b/update.sh @@ -15,6 +15,7 @@ latests=( $(curl -sSL 'https://nextcloud.com/changelog/' |tac|tac| \ grep -o "\(Version\|Release\)\s\+[[:digit:]]\+\(\.[[:digit:]]\+\)\+" | \ awk '{ print $2 }' | sort -V ) ) +travisEnv= for latest in "${latests[@]}"; do version=$(echo "$latest" | cut -d. -f1-2) @@ -44,5 +45,14 @@ for latest in "${latests[@]}"; do # Copy the docker-entrypoint. cp docker-entrypoint.sh "$version/$variant/docker-entrypoint.sh" + + travisEnv='\n - VERSION='"$version"' VARIANT='"$variant$travisEnv" done done + +# update .travis.yml +travis="$(awk -v 'RS=\n\n' '$1 == "env:" { $0 = "env:'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)" +echo "$travis" > .travis.yml + +# remove duplicate entries +echo "$(awk '!NF || !seen[$0]++' .travis.yml)" > .travis.yml