Skip to content

Commit

Permalink
buildkite: generate docker image with tag master on every merge (cade…
Browse files Browse the repository at this point in the history
  • Loading branch information
venkat1109 authored Jun 11, 2019
1 parent b6ac934 commit d14a6c8
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 7 deletions.
33 changes: 32 additions & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ steps:
queue: "workers"
docker: "*"
command: "make cover_integration_ci"
retry:
automatic:
limit: 1
plugins:
- docker-compose#v3.0.0:
run: integration-test-cassandra
Expand All @@ -24,6 +27,9 @@ steps:
queue: "workers"
docker: "*"
command: "make cover_integration_ci EVENTSV2=true"
retry:
automatic:
limit: 1
plugins:
- docker-compose#v3.0.0:
run: integration-test-cassandra
Expand All @@ -34,6 +40,9 @@ steps:
queue: "workers"
docker: "*"
command: "make cover_xdc_ci"
retry:
automatic:
limit: 1
plugins:
- docker-compose#v3.0.0:
run: integration-test-xdc-cassandra
Expand All @@ -44,6 +53,9 @@ steps:
queue: "workers"
docker: "*"
command: "make cover_integration_ci"
retry:
automatic:
limit: 1
plugins:
- docker-compose#v3.0.0:
run: integration-test-mysql
Expand All @@ -54,6 +66,9 @@ steps:
queue: "workers"
docker: "*"
command: "make cover_integration_ci EVENTSV2=true"
retry:
automatic:
limit: 1
plugins:
- docker-compose#v3.0.0:
run: integration-test-mysql
Expand All @@ -64,9 +79,25 @@ steps:
queue: "workers"
docker: "*"
command: "make cover_xdc_ci"
retry:
automatic:
limit: 1
plugins:
- docker-compose#v3.0.0:
run: integration-test-xdc-mysql
config: docker/buildkite/docker-compose.yml

- wait
- wait

- label: ":docker: build and push master"
agents:
queue: "workers"
docker: "*"
command: "scripts/buildkite/docker-push.sh"
retry:
automatic:
limit: 1
plugins:
- docker-login#v2.0.1:
username: ubercadence
password-env: DOCKER_LOGIN_PASSWORD
10 changes: 4 additions & 6 deletions host/elasticsearch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ package host

import (
"bytes"
"context"
"encoding/json"
"flag"
"fmt"
Expand Down Expand Up @@ -181,8 +182,8 @@ func (s *elasticsearchIntegrationSuite) TestListWorkflow_SearchAttribute() {
s.testHelperForReadOnce(we.GetRunId(), query, false)
}

/*
func (s *elasticsearchIntegrationSuite) TestListWorkflow_PageToken() {
s.T().Skip("fixme: flaky test")
id := "es-integration-list-workflow-token-test"
wt := "es-integration-list-workflow-token-test-type"
tl := "es-integration-list-workflow-token-test-tasklist"
Expand All @@ -193,10 +194,9 @@ func (s *elasticsearchIntegrationSuite) TestListWorkflow_PageToken() {

s.testListWorkflowHelper(numOfWorkflows, pageSize, request, id, wt, false)
}
*/

/*
func (s *elasticsearchIntegrationSuite) TestListWorkflow_SearchAfter() {
s.T().Skip("fixme: flaky test")
id := "es-integration-list-workflow-searchAfter-test"
wt := "es-integration-list-workflow-searchAfter-test-type"
tl := "es-integration-list-workflow-searchAfter-test-tasklist"
Expand All @@ -207,7 +207,6 @@ func (s *elasticsearchIntegrationSuite) TestListWorkflow_SearchAfter() {

s.testListWorkflowHelper(numOfWorkflows, pageSize, request, id, wt, false)
}
*/

func (s *elasticsearchIntegrationSuite) TestListWorkflow_OrQuery() {
id := "es-integration-list-workflow-or-query-test"
Expand Down Expand Up @@ -314,9 +313,9 @@ func (s *elasticsearchIntegrationSuite) TestListWorkflow_OrQuery() {
s.Equal(3, searchVal)
}

/*
// To test last page search trigger max window size error
func (s *elasticsearchIntegrationSuite) TestListWorkflow_MaxWindowSize() {
s.T().Skip("fixme: flaky test")
// set es index index settings
indexName := s.testClusterConfig.ESConfig.Indices[common.VisibilityAppName]
_, err := s.esClient.IndexPutSettings(indexName).
Expand Down Expand Up @@ -370,7 +369,6 @@ func (s *elasticsearchIntegrationSuite) TestListWorkflow_MaxWindowSize() {
Do(context.Background())
s.NoError(err)
}
*/

func (s *elasticsearchIntegrationSuite) TestListWorkflow_OrderBy() {
id := "es-integration-list-workflow-order-by-test"
Expand Down
28 changes: 28 additions & 0 deletions scripts/buildkite/docker-push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -ex

# if current branch is not master, this PR is not merged to master yet
if [ "$BUILDKITE_BRANCH" != "master" ]; then
echo "Skipping docker-push since this change is not in master yet"
exit 0
fi

MASTER_SHA=$(git rev-parse origin/master)

# if this commit is not the same as tip of master, lets skip this and
# let the commit at tip of master do the push
if [ "$BUILDKITE_COMMIT" != "$MASTER_SHA" ]; then
echo "Skipping docker-push for this commit since tip of master is already ahead"
exit 0
fi

cd docker

echo "Building docker image for $BUILDKITE_MESSAGE"

docker build . -f Dockerfile -t ubercadence/server:master --build-arg git_branch=$BUILDKITE_COMMIT
docker push ubercadence/server:master

docker build . -f Dockerfile-cli -t ubercadence/cli:master --build-arg git_branch=$BUILDKITE_COMMIT
docker push ubercadence/cli:master

0 comments on commit d14a6c8

Please sign in to comment.