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

Add github action for jaeger all-in-one image #2663

Merged
merged 9 commits into from
Nov 29, 2020
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
57 changes: 57 additions & 0 deletions .github/workflows/all-in-one-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build all-in-one

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
all-in-one:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Fetch git tags
run: |
git fetch --prune --unshallow --tags

- uses: actions/setup-go@v2
with:
go-version: ^1.15

- uses: actions/setup-node@v2-beta
with:
node-version: '10'

- uses: docker/login-action@v1
id: dockerhub-login
with:
username: jaegertracingbot
password: ${{ secrets.DOCKERHUB_TOKEN }}
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
if: env.DOCKERHUB_TOKEN != null

- name: Export DOCKERHUB_LOGIN variable
run: |
echo "DOCKERHUB_LOGIN=true" >> $GITHUB_ENV
if: steps.dockerhub-login.outcome == 'success'

- name: Export BRANCH variable for pull_request event
run: |
echo "BRANCH=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be better for debugging to print the derived value

Suggested change
echo "BRANCH=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
export BRANCH=${GITHUB_HEAD_REF}
echo "we are on branch=$BRANCH"
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV

if: github.event_name == 'pull_request'

- name: Export BRANCH variable for push event
run: |
echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
if: github.event_name == 'push'

- name: Install tools
run: make install-ci

- name: Build, test, and publish all-in-one image
run: bash scripts/travis/build-all-in-one-image.sh
3 changes: 3 additions & 0 deletions .github/workflows/es-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ jobs:
with:
go-version: ^1.15

- name: Install tools
run: make install-ci

- name: Run elasticsearch integration tests
run: bash scripts/travis/es-integration-test.sh
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Title "Release X.Y.Z"
* Tag `vX.Y.Z` (note the `v` prefix) and choose appropriate branch
* Copy the new CHANGELOG.md section into the release notes
4. The release tag will trigger a build of the docker images
4. The release tag will trigger a build of the docker images. Since forks don't have jaegertracingbot dockerhub token, they can never publish images to jaegertracing organisation.
5. Once the images are available on [Docker Hub](https://hub.docker.com/r/jaegertracing/), announce the release on the mailing list, gitter, and twitter.
6. Publish documentation for the new version in [jaegertracing.io](https://github.com/jaegertracing/documentation).

Expand Down
15 changes: 12 additions & 3 deletions scripts/travis/build-all-in-one-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,16 @@ BRANCH=${BRANCH:?'missing BRANCH env var'}
# `GOARCH=<target arch> ./scripts/travis/build-all-in-one-image.sh`.
GOARCH=${GOARCH:-$(go env GOARCH)}

source ~/.nvm/nvm.sh
nvm use 10
expected_version="v10"
version=$(node --version)
major_version=${version%.*.*}
if [ "$major_version" = "$expected_version" ] ; then
echo "Node version is as expected: $version"
else
echo "ERROR: installed Node version $version doesn't match expected version $expected_version"
exit 1
fi

make build-ui

set +e
Expand All @@ -28,7 +36,7 @@ run_integration_test() {

Ashmita152 marked this conversation as resolved.
Show resolved Hide resolved
upload_to_docker() {
# Only push the docker container to Docker Hub for master branch
if [[ ("$BRANCH" == "master" || $BRANCH =~ ^v[0-9]+\.[0-9]+\.[0-9]+$) && "$TRAVIS_SECURE_ENV_VARS" == "true" ]]; then
Ashmita152 marked this conversation as resolved.
Show resolved Hide resolved
if [[ ("$BRANCH" == "master" || $BRANCH =~ ^v[0-9]+\.[0-9]+\.[0-9]+$) && "DOCKERHUB_LOGIN" == "true" ]]; then
echo "upload $1 to Docker Hub"
export REPO=$1
bash ./scripts/travis/upload-to-docker.sh
Expand All @@ -38,6 +46,7 @@ upload_to_docker() {
}

make build-all-in-one GOOS=linux GOARCH=$GOARCH
make create-baseimg-debugimg
repo=jaegertracing/all-in-one
docker build -f cmd/all-in-one/Dockerfile \
--target release \
Expand Down
2 changes: 1 addition & 1 deletion scripts/travis/es-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [ "$ES_OTEL_INTEGRATION_TEST" == true ]; then
exit 0
fi

echo "Executing token propatagion test"
echo "Executing token propagation test"

# Mock UI, needed only for build query service.
make build-crossdock-ui-placeholder
Expand Down