Skip to content

Commit 48c74b3

Browse files
authored
Add buildkite configuration for automated builds on github (temporalio#55)
* Add buildkite configuration for automated builds on github * Update readme
1 parent adfa297 commit 48c74b3

4 files changed

Lines changed: 59 additions & 0 deletions

File tree

.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: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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 run the build locally, start from the root folder of this repo and run the following command:
10+
```bash
11+
docker-compose -f docker/buildkite/docker-compose.yaml run unit-test
12+
```
13+
14+
Note that BuildKite will run basically the same commands.
15+
16+
## Testing the build in BuildKite
17+
Creating a PR against the master branch will trigger the BuildKite
18+
build. Members of the Temporal team can view the build pipeline here:
19+
https://buildkite.com/temporal/java-samples
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)