Skip to content
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
12 changes: 12 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
steps:
- label: ":java: Unit test"
agents:
queue: "default"
docker: "*"
command: "./gradlew --no-daemon test"
timeout_in_minutes: 15
plugins:
- docker-compose#v3.0.0:
run: unit-test
config: docker/buildkite/docker-compose.yaml
- wait
16 changes: 16 additions & 0 deletions docker/buildkite/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM openjdk:8-alpine

# Based on https://github.com/sgerrand/alpine-pkg-glibc
# Needed to run protoc java plugin
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.31-r0/glibc-2.31-r0.apk
RUN apk add glibc-2.31-r0.apk

# Install dependencies using apk
RUN apk update && apk add --virtual wget ca-certificates wget && apk add protobuf

# Git is needed in order to update the dls submodule
RUN apk add --virtual git

RUN mkdir /temporal-java-samples
WORKDIR /temporal-java-samples
19 changes: 19 additions & 0 deletions docker/buildkite/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Using BuildKite

BuildKite simply runs Docker containers. So it is easy to perform the
same build locally that BuildKite will do. To handle this, there are
two different docker-compose files: one for BuildKite and one for local.
The Dockerfile is the same for both.

## Testing the build locally
To run the build locally, start from the root folder of this repo and run the following command:
```bash
docker-compose -f docker/buildkite/docker-compose.yaml run unit-test
```

Note that BuildKite will run basically the same commands.

## Testing the build in BuildKite
Creating a PR against the master branch will trigger the BuildKite
build. Members of the Temporal team can view the build pipeline here:
https://buildkite.com/temporal/java-samples
12 changes: 12 additions & 0 deletions docker/buildkite/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3.5'

services:
unit-test:
build:
context: ../../
dockerfile: ./docker/buildkite/Dockerfile
command: "./gradlew --no-daemon test"
environment:
- "USER=unittest"
volumes:
- "../../:/temporal-java-samples"