Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix whitespace, add pgp-happy-eyeballs, and run update.sh #86

Merged
merged 1 commit into from
Oct 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,28 @@ language: bash
services: docker

env:
- VERSION=6 VARIANT=
- VERSION=6.4.1 VARIANT=
- VERSION=6.4.0 VARIANT=
- VERSION=5 VARIANT=
- VERSION=6.4.1
- VERSION=6.4.0
- VERSION=6
- VERSION=5

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

before_script:
- env | sort
- wget -qO- 'https://github.com/tianon/pgp-happy-eyeballs/raw/master/hack-my-builds.sh' | bash
- cd "$VERSION"
- image="kibana:$VERSION"

script:
- travis_retry docker build -t "$image" .
- ~/official-images/test/run.sh "$image"
- |
(
set -Eeuo pipefail
set -x
docker build -t "$image" .
~/official-images/test/run.sh "$image"
)

after_script:
- docker images
Expand Down
20 changes: 9 additions & 11 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,28 @@ for version in "${versions[@]}"; do
plainVersion="${fullVersion%%-*}" # strip non-upstream-version
plainVersion="${plainVersion##*:}" # strip epoch
tilde='~'; plainVersion="${plainVersion//$tilde/-}" # replace '~' with '-'

sha1=

sha1=


if [ $majorVersion -ge 6 ]; then
if [ $majorVersion -ge 6 ]; then
# Use the "upstream" Dockerfile, which rebundles the existing image from Elastic.
upstreamImage="docker.elastic.co/kibana/kibana:$plainVersion"

# Parse image manifest for sha
authToken="$(curl -fsSL 'https://docker-auth.elastic.co/auth?service=token-service&scope=repository:kibana/kibana:pull' | jq -r .token)"
digest="$(curl --head -fsSL -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' -H "Authorization: Bearer $authToken" "https://docker.elastic.co/v2/kibana/kibana/manifests/$plainVersion" | tr -d '\r' | gawk -F ':[[:space:]]+' '$1 == "Docker-Content-Digest" { print $2 }')"
# Format image reference (image@sha)
upstreamImageDigest="$upstreamImage@$digest"
digest="$(curl --head -fsSL -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' -H "Authorization: Bearer $authToken" "https://docker.elastic.co/v2/kibana/kibana/manifests/$plainVersion" | tr -d '\r' | gawk -F ':[[:space:]]+' '$1 == "Docker-Content-Digest" { print $2 }')"

# Format image reference (image@sha)
upstreamImageDigest="$upstreamImage@$digest"

(
set -x
sed '
s!%%KIBANA_VERSION%%!'"$plainVersion"'!g;
s!%%UPSTREAM_IMAGE_DIGEST%%!'"$upstreamImageDigest"'!g;
' Dockerfile-upstream.template > "$version/Dockerfile"
)
travisEnv='\n - VERSION='"$version VARIANT=$travisEnv"
travisEnv='\n - VERSION='"$version$travisEnv"
else
repoBase='https://artifacts.elastic.co/packages/5.x/apt'

Expand Down Expand Up @@ -92,7 +90,7 @@ for version in "${versions[@]}"; do
)

travisEnv='\n - VERSION='"$version$travisEnv"
fi
fi
done

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