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

Build platform binaries as part of CI #1909

Merged
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
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ script:
- if [ "$TESTS" == true ]; then make test-ci ; else echo 'skipping tests'; fi
- if [ "$ALL_IN_ONE" == true ]; then bash ./scripts/travis/build-all-in-one-image.sh ; else echo 'skipping all_in_one'; fi
- if [ "$CROSSDOCK" == true ]; then bash ./scripts/travis/build-crossdock.sh ; else echo 'skipping crossdock'; fi
- if [ "$DOCKER" == true ]; then bash ./scripts/travis/build-docker-images.sh ; else echo 'skipping docker images'; fi
- if [ "$DOCKER" == true ]; then bash ./scripts/travis/build-docker-images.sh ; else echo 'skipping build-docker-images'; fi
- if [ "$DEPLOY" == true ]; then make build-all-platforms ; else echo 'skipping build-all-platforms'; fi
- if [ "$ES_INTEGRATION_TEST" == true ]; then bash ./scripts/travis/es-integration-test.sh ; else echo 'skipping elastic search integration test'; fi
- if [ "$KAFKA_INTEGRATION_TEST" == true ]; then bash ./scripts/travis/kafka-integration-test.sh ; else echo 'skipping kafka integration test'; fi
- if [ "$CASSANDRA_INTEGRATION_TEST" == true ]; then bash ./scripts/travis/cassandra-integration-test.sh ; else echo 'skipping cassandra integration test'; fi
Expand All @@ -94,7 +95,8 @@ after_failure:
- if [ "$CROSSDOCK" == true ]; then make crossdock-logs ; else echo 'skipping crossdock'; fi

before_deploy:
- if [ "$DEPLOY" == true ]; then make build-all-platforms && bash ./scripts/travis/package-deploy.sh ; else echo 'skipping deploy'; fi
- if [ "$DOCKER" == true ]; then bash ./scripts/travis/upload-all-docker-images.sh ; else echo 'skipping docker upload'; fi
- if [ "$DEPLOY" == true ]; then bash ./scripts/travis/package-deploy.sh ; else echo 'skipping deploying binaries'; fi

deploy:
provider: releases
Expand Down
24 changes: 3 additions & 21 deletions scripts/travis/build-docker-images.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,12 @@
#!/bin/bash
#
# Build UI and all Docker images

set -e

if [[ "$TRAVIS_SECURE_ENV_VARS" == "false" ]]; then
echo "skip docker upload, TRAVIS_SECURE_ENV_VARS=$TRAVIS_SECURE_ENV_VARS"
exit 0
fi

BRANCH=${BRANCH:?'missing BRANCH env var'}

# Only push images to Docker Hub for master branch or for release tags vM.N.P
if [[ "$BRANCH" == "master" || $BRANCH =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "upload to Docker Hub, BRANCH=$BRANCH"
else
echo 'skip Docker upload, only allowed for tagged releases or master (latest tag)'
exit 0
fi

# TODO avoid building the UI when on a PR branch: https://github.com/jaegertracing/jaeger/issues/1908
source ~/.nvm/nvm.sh
nvm use 10

export DOCKER_NAMESPACE=jaegertracing
make docker

for component in agent cassandra-schema es-index-cleaner es-rollover collector query ingester
do
export REPO="jaegertracing/jaeger-${component}"
bash ./scripts/travis/upload-to-docker.sh
done
27 changes: 27 additions & 0 deletions scripts/travis/upload-all-docker-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# this script should only be run after build-docker-images.sh

set -e

BRANCH=${BRANCH:?'missing BRANCH env var'}

if [[ "$TRAVIS_SECURE_ENV_VARS" == "false" ]]; then
echo "skip docker upload, TRAVIS_SECURE_ENV_VARS=$TRAVIS_SECURE_ENV_VARS"
exit 0
fi

# Only push images to Docker Hub for master branch or for release tags vM.N.P
if [[ "$BRANCH" == "master" || $BRANCH =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "upload to Docker Hub, BRANCH=$BRANCH"
else
echo 'skip Docker upload, only allowed for tagged releases or master (latest tag)'
exit 0
fi

export DOCKER_NAMESPACE=jaegertracing
for component in agent cassandra-schema es-index-cleaner es-rollover collector query ingester
do
export REPO="jaegertracing/jaeger-${component}"
bash ./scripts/travis/upload-to-docker.sh
done