Skip to content

Commit 647b7f8

Browse files
committed
Add buildkite configuration for automated builds on github
1 parent adfa297 commit 647b7f8

File tree

4 files changed

+94
-0
lines changed

4 files changed

+94
-0
lines changed

.buildkite/pipeline.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
steps:
2+
- label: ":java: Unit test"
3+
agents:
4+
queue: "default"
5+
docker: "*"
6+
command: "./gradlew --no-daemon test"
7+
timeout_in_minutes: 15
8+
plugins:
9+
- docker-compose#v3.0.0:
10+
run: unit-test
11+
config: docker/buildkite/docker-compose.yaml
12+
- wait

docker/buildkite/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM openjdk:8-alpine
2+
3+
# Based on https://github.com/sgerrand/alpine-pkg-glibc
4+
# Needed to run protoc java plugin
5+
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
6+
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.31-r0/glibc-2.31-r0.apk
7+
RUN apk add glibc-2.31-r0.apk
8+
9+
# Install dependencies using apk
10+
RUN apk update && apk add --virtual wget ca-certificates wget && apk add protobuf
11+
12+
# Git is needed in order to update the dls submodule
13+
RUN apk add --virtual git
14+
15+
RUN mkdir /temporal-java-samples
16+
WORKDIR /temporal-java-samples

docker/buildkite/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Using BuildKite
2+
3+
BuildKite simply runs Docker containers. So it is easy to perform the
4+
same build locally that BuildKite will do. To handle this, there are
5+
two different docker-compose files: one for BuildKite and one for local.
6+
The Dockerfile is the same for both.
7+
8+
## Testing the build locally
9+
To try out the build locally, start from the root folder of this repo
10+
(temporal-java-client) and run the following commands.
11+
12+
Build the container for
13+
14+
unit tests:
15+
```bash
16+
docker-compose -f docker/buildkite/docker-compose-local.yml build unit-test-test-service
17+
```
18+
19+
unit tests with docker sticky on:
20+
```bash
21+
docker-compose -f docker/buildkite/docker-compose-local.yml build unit-test-docker-sticky-on
22+
```
23+
24+
unit tests with docker sticky off:
25+
```bash
26+
docker-compose -f docker/buildkite/docker-compose-local.yml build unit-test-docker-sticky-off
27+
```
28+
29+
Run the integration tests:
30+
31+
unit tests:
32+
```bash
33+
docker-compose -f docker/buildkite/docker-compose-local.yml run unit-test-test-service
34+
```
35+
36+
unit tests with docker sticky on:
37+
```bash
38+
docker-compose -f docker/buildkite/docker-compose-local.yml run unit-test-docker-sticky-on
39+
```
40+
41+
unit tests with docker sticky off:
42+
```bash
43+
docker-compose -f docker/buildkite/docker-compose-local.yml run unit-test-docker-sticky-off
44+
```
45+
46+
Note that BuildKite will run basically the same commands.
47+
48+
## Testing the build in BuildKite
49+
Creating a PR against the master branch will trigger the BuildKite
50+
build. Members of the Temporal team can view the build pipeline here:
51+
https://buildkite.com/temporal/temporal-java-client
52+
53+
Eventually this pipeline should be made public. It will need to ignore
54+
third party PRs for safety reasons.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: '3.5'
2+
3+
services:
4+
unit-test:
5+
build:
6+
context: ../../
7+
dockerfile: ./docker/buildkite/Dockerfile
8+
command: "./gradlew --no-daemon test"
9+
environment:
10+
- "USER=unittest"
11+
volumes:
12+
- "../../:/temporal-java-samples"

0 commit comments

Comments
 (0)