Skip to content

Commit

Permalink
Build platform binaries as part of CI (#1909)
Browse files Browse the repository at this point in the history
* Build platform binaries as part of CI

Signed-off-by: Yuri Shkuro <[email protected]>

* Separate steps more

Signed-off-by: Yuri Shkuro <[email protected]>
  • Loading branch information
yurishkuro authored Nov 7, 2019
1 parent f68ece0 commit e17a37b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 23 deletions.
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

0 comments on commit e17a37b

Please sign in to comment.