Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
Updates scripts for fpm and apache
Browse files Browse the repository at this point in the history
  • Loading branch information
pierreozoux committed Sep 29, 2015
1 parent 12a4960 commit 5633ab9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 22 deletions.
16 changes: 10 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,25 @@ language: bash
sudo: 9000

env:
- VERSION=8.1
- VERSION=8.0
- VERSION=7.0
- VERSION=6.0
- VERSION=8.1 VARIANT=fpm
- VERSION=8.1 VARIANT=apache
- VERSION=8.0 VARIANT=fpm
- VERSION=8.0 VARIANT=apache
- VERSION=7.0 VARIANT=fpm
- VERSION=7.0 VARIANT=apache
- VERSION=6.0 VARIANT=fpm
- VERSION=6.0 VARIANT=apache

install:
- git clone https://github.com/docker-library/official-images.git ~/official-images

before_script:
- env | sort
- cd "$VERSION"
- image="owncloud:$VERSION"
- image="owncloud:${VERSION}${VARIANT:+-$VARIANT}"

script:
- docker build -t "$image" .
- docker build -t "$image" "${VARIANT}"
- ~/official-images/test/run.sh "$image"

after_script:
Expand Down
35 changes: 22 additions & 13 deletions generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,27 @@ url='git://github.com/docker-library/owncloud'
echo '# maintainer: InfoSiftr <[email protected]> (@infosiftr)'

for version in "${versions[@]}"; do
commit="$(cd "$version" && git log -1 --format='format:%H' -- Dockerfile $(awk 'toupper($1) == "COPY" { for (i = 2; i < NF; i++) { print $i } }' Dockerfile))"
fullVersion="$(grep -m1 'ENV OWNCLOUD_VERSION ' "$version/Dockerfile" | cut -d' ' -f3)"

versionAliases=()
while [ "$fullVersion" != "$version" -a "${fullVersion%[.-]*}" != "$fullVersion" ]; do
versionAliases+=( $fullVersion )
fullVersion="${fullVersion%[.-]*}"
done
versionAliases+=( $version ${aliases[$version]} )

echo
for va in "${versionAliases[@]}"; do
echo "$va: ${url}@${commit} $version"
for variant in apache fpm; do
commit="$(cd "$version/$variant" && git log -1 --format='format:%H' -- Dockerfile $(awk 'toupper($1) == "COPY" { for (i = 2; i < NF; i++) { print $i } }' Dockerfile))"
fullVersion="$(grep -m1 'ENV OWNCLOUD_VERSION ' "$version/$variant/Dockerfile" | cut -d' ' -f3)"

versionAliases=()
while [ "$fullVersion" != "$version" -a "${fullVersion%[.-]*}" != "$fullVersion" ]; do
versionAliases+=( $fullVersion )
fullVersion="${fullVersion%[.-]*}"
done
versionAliases+=( $version ${aliases[$version]} )

echo
for va in "${versionAliases[@]}"; do
echo "$va-$variant: ${url}@${commit} $version/$variant"
if [ "${variant}" == "apache" ]; then
echo "$va: ${url}@${commit} $version/$variant"
else
if [ "$va" == "latest" ]; then
echo "$variant: ${url}@${commit} $version/$variant"
fi
fi
done
done
done
7 changes: 4 additions & 3 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ versions=( "${versions[@]%/}" )
travisEnv=
for version in "${versions[@]}"; do
latest=$(curl -sSL 'https://owncloud.org/changelog/' |tac|tac| grep -o -m 1 "\(Version\|Release\) ${version}.[[:digit:]]\+" | sed -rn 's/(Version|Release) (.*)/\2/p')
sed -ri -e 's/^(ENV OWNCLOUD_VERSION) .*/\1 '"$latest"'/' "$version/Dockerfile"

travisEnv='\n - VERSION='"$version$travisEnv"
for variant in apache fpm; do
sed -ri -e 's/^(ENV OWNCLOUD_VERSION) .*/\1 '"$latest"'/' "$version/$variant/Dockerfile"
travisEnv='\n - VERSION='"$version"' VARIANT='"$variant$travisEnv"
done
done

travis="$(awk -v 'RS=\n\n' '$1 == "env:" { $0 = "env:'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)"
Expand Down

0 comments on commit 5633ab9

Please sign in to comment.