Skip to content

Commit

Permalink
Update buildkite workers (uber#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
bufdev authored Apr 23, 2019
1 parent f08c362 commit 5d11053
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 11 deletions.
43 changes: 40 additions & 3 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,53 @@
steps:
- name: ':docker: :package:'
- name: ':docker: :package: buildkite'
plugins:
- docker-compose#v3.0.2:
build: buildkite
image-repository: 027047743804.dkr.ecr.us-east-2.amazonaws.com/uber
agents:
queue: builders
- name: ':docker: :package: app'
plugins:
- docker-compose#v3.0.2:
build: app
image-repository: 027047743804.dkr.ecr.us-east-2.amazonaws.com/uber
agents:
queue: builders
- wait
- name: ':make:'
command: make all codecov
- name: 'make lint'
command: make lint
plugins:
- docker-compose#v3.0.2:
run: buildkite
agents:
queue: workers
- name: 'make codecov'
command: make codecov
plugins:
- docker-compose#v3.0.2:
run: buildkite
agents:
queue: workers
- name: 'make bazeltest'
command: make bazeltest
plugins:
- docker-compose#v3.0.2:
run: buildkite
agents:
queue: workers
- name: 'make bazelbuild'
command: make bazelbuild
plugins:
- docker-compose#v3.0.2:
run: buildkite
agents:
queue: workers
- name: 'docker test'
command: bash etc/docker/testing/bin/test.sh
plugins:
- docker-compose#v3.0.2:
run: app
volumes:
- "./:/work"
agents:
queue: workers
5 changes: 2 additions & 3 deletions Dockerfile.buildkite
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
FROM golang:1.12.4-stretch

ENV GO111MODULE=on
ENV GOPATH=

ENV GO111MODULE=on \
GOPATH=
RUN apt-get update -yq && \
apt-get install -yq build-essential unzip && \
rm -rf /var/lib/apt/lists/*
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ cover:
@echo open $(TMP_ETC)/coverage.html

.PHONY: codecov
codecov:
codecov: cover
bash <(curl -s https://codecov.io/bash) -c -f $(TMP_ETC)/coverage.txt

.PHONY: bazeltest
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ services:
- BUILDKITE_PROJECT_SLUG
- BUILDKITE_PULL_REQUEST
- BUILDKITE_TAG
app:
build:
context: .
dockerfile: Dockerfile
cache_from:
- golang:1.12.4-alpine3.9
11 changes: 7 additions & 4 deletions etc/docker/testing/bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ check_command_output() {
}

check_command_output_file() {
tmp_file="$(mktemp)"
trap 'rm -rf "${tmp_file}"' EXIT
tmp_file1="$(mktemp)"
tmp_file2="$(mktemp)"
trap 'rm -rf "${tmp_file1}"' EXIT
trap 'rm -rf "${tmp_file2}"' EXIT
echo "Checking that '${*:2}' results in the contents of '${1}'"
"${@:2}" > "${tmp_file}"
if ! diff "${1}" "${tmp_file}"; then
cat "${1}" | sort > "${tmp_file1}"
"${@:2}" | sort > "${tmp_file2}"
if ! diff "${tmp_file1}" "${tmp_file2}"; then
echo "Diff detected" >&2
exit 1
fi
Expand Down

0 comments on commit 5d11053

Please sign in to comment.