Skip to content

Commit 8a7f8f1

Browse files
authored
Minor project updates (#83)
* chore(ci): align CI with other community projects * chore(ci): build docker image using Jib * chore(app): change format of application properties * chore(docker): provider docker-compose file for development * chore(app): increase job timeout
1 parent 4c3fadc commit 8a7f8f1

File tree

11 files changed

+236
-132
lines changed

11 files changed

+236
-132
lines changed

.ci/podSpecs/distribution.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
metadata:
2+
labels:
3+
agent: zeebe-ci-build
4+
spec:
5+
nodeSelector:
6+
cloud.google.com/gke-nodepool: agents-n1-standard-32-netssd-preempt
7+
tolerations:
8+
- key: "agents-n1-standard-32-netssd-preempt"
9+
operator: "Exists"
10+
effect: "NoSchedule"
11+
volumes:
12+
- name: shared-data
13+
emptyDir: {}
14+
containers:
15+
- name: maven
16+
image: maven:3.6.0-jdk-11
17+
command: ["cat"]
18+
tty: true
19+
env:
20+
- name: LIMITS_CPU
21+
valueFrom:
22+
resourceFieldRef:
23+
resource: limits.cpu
24+
- name: JAVA_TOOL_OPTIONS
25+
value: |
26+
-XX:+UseContainerSupport
27+
- name: DOCKER_HOST
28+
value: tcp://localhost:2375
29+
- name: ZEEBE_CI_SHARED_DATA
30+
value: /home/shared
31+
resources:
32+
limits:
33+
cpu: 2
34+
memory: 4Gi
35+
requests:
36+
cpu: 2
37+
memory: 4Gi
38+
securityContext:
39+
privileged: true
40+
volumeMounts:
41+
- name: shared-data
42+
mountPath: /home/shared
43+
mountPropagation: Bidirectional
44+
- name: docker
45+
image: docker:18.09.4-dind
46+
args: ["--storage-driver=overlay2"]
47+
securityContext:
48+
privileged: true
49+
tty: true
50+
resources:
51+
limits:
52+
cpu: 2
53+
memory: 4Gi
54+
requests:
55+
cpu: 2
56+
memory: 4Gi
57+
volumeMounts:
58+
- name: shared-data
59+
mountPath: /home/shared
60+
mountPropagation: Bidirectional

.ci/scripts/distribution/prepare.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh -eux
2+
3+
apt-get -qq update
4+
apt-get install --no-install-recommends -qq -y jq libatomic1

.ci/scripts/github-release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export PROJECT_NAME="Zeebe HTTP Worker"
66
export GITHUB_TOKEN=${GITHUB_TOKEN_PSW}
77
export GITHUB_ORG=zeebe-io
88
export GITHUB_REPO=zeebe-http-worker
9-
export ARTIFACT=zeebe-http-worker.jar
9+
export ARTIFACT=zeebe-http-worker-${RELEASE_VERSION}.jar
1010
export CHECKSUM=${ARTIFACT}.sha1sum
1111

1212
# create checksum files

Dockerfile

Lines changed: 0 additions & 4 deletions
This file was deleted.

Jenkinsfile

Lines changed: 10 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,7 @@ pipeline {
77
cloud 'zeebe-ci'
88
label "zeebe-ci-build_${buildName}"
99
defaultContainer 'jnlp'
10-
yaml '''\
11-
apiVersion: v1
12-
kind: Pod
13-
metadata:
14-
labels:
15-
agent: zeebe-ci-build
16-
spec:
17-
nodeSelector:
18-
cloud.google.com/gke-nodepool: agents-n1-standard-32-netssd-preempt
19-
tolerations:
20-
- key: "agents-n1-standard-32-netssd-preempt"
21-
operator: "Exists"
22-
effect: "NoSchedule"
23-
containers:
24-
- name: maven
25-
image: maven:3.6.0-jdk-11
26-
command: ["cat"]
27-
tty: true
28-
resources:
29-
limits:
30-
cpu: 1
31-
memory: 2Gi
32-
requests:
33-
cpu: 1
34-
memory: 2Gi
35-
- name: docker
36-
image: docker:18.09.4-dind
37-
args: ["--storage-driver=overlay2"]
38-
securityContext:
39-
privileged: true
40-
tty: true
41-
resources:
42-
limits:
43-
cpu: 1
44-
memory: 1Gi
45-
requests:
46-
cpu: 500m
47-
memory: 512Mi
48-
'''
10+
yamlFile '.ci/podSpecs/distribution.yml'
4911
}
5012
}
5113

@@ -71,8 +33,7 @@ spec:
7133
steps {
7234
container('maven') {
7335
configFileProvider([configFile(fileId: 'maven-nexus-settings-zeebe', variable: 'MAVEN_SETTINGS_XML')]) {
74-
sh 'apt-get update'
75-
sh 'apt-get install --no-install-recommends -qq -y libatomic1'
36+
sh '.ci/scripts/distribution/prepare.sh'
7637
sh 'mvn clean install -B -s $MAVEN_SETTINGS_XML -DskipTests'
7738
}
7839
}
@@ -90,9 +51,6 @@ spec:
9051
sh 'mvn install -B -s $MAVEN_SETTINGS_XML'
9152
}
9253
}
93-
container('docker') {
94-
sh 'docker build -t camunda/zeebe-http-worker:SNAPSHOT .'
95-
}
9654
}
9755

9856
post {
@@ -110,9 +68,6 @@ spec:
11068
sh 'mvn -B -s $MAVEN_SETTINGS_XML generate-sources source:jar javadoc:jar deploy -DskipTests'
11169
}
11270
}
113-
container('docker') {
114-
sh 'docker push camunda/zeebe-http-worker:SNAPSHOT'
115-
}
11671
}
11772
}
11873

@@ -127,6 +82,7 @@ spec:
12782
GITHUB_TOKEN = credentials('camunda-jenkins-github')
12883
RELEASE_VERSION = "${params.RELEASE_VERSION}"
12984
DEVELOPMENT_VERSION = "${params.DEVELOPMENT_VERSION}"
85+
DOCKER_HUB = credentials("camunda-dockerhub")
13086
}
13187

13288
steps {
@@ -140,16 +96,15 @@ spec:
14096
sh 'mkdir ~/.ssh/ && ssh-keyscan github.com >> ~/.ssh/known_hosts'
14197
sh 'mvn -B -s $MAVEN_SETTINGS_XML -DskipTests source:jar javadoc:jar release:prepare release:perform -Prelease'
14298
sh '.ci/scripts/github-release.sh'
143-
}
99+
}
144100
}
145101
}
146-
147-
container('docker') {
148-
sh 'docker build -t camunda/zeebe-http-worker:SNAPSHOT .'
149-
sh 'docker tag camunda/zeebe-http-worker:SNAPSHOT camunda/zeebe-http-worker:${RELEASE_VERSION}'
150-
sh 'docker push camunda/zeebe-http-worker:${RELEASE_VERSION}'
151-
sh 'docker tag camunda/zeebe-http-worker:SNAPSHOT camunda/zeebe-http-worker:latest'
152-
sh 'docker push camunda/zeebe-http-worker:latest'
102+
container('maven') {
103+
configFileProvider([configFile(fileId: 'maven-nexus-settings-zeebe', variable: 'MAVEN_SETTINGS_XML')]) {
104+
sshagent(['camunda-jenkins-github-ssh']) {
105+
sh 'mvn jib:build -Djib.to.tags=latest,${RELEASE_VERSION} -Djib.to.auth.username=${DOCKER_HUB_USR} -Djib.to.auth.password=${DOCKER_HUB_PSW}'
106+
}
107+
}
153108
}
154109
}
155110
}

README.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
A Zeebe worker to make HTTP calls (e.g. invoking a REST service). It is based on the built-in Java HttpClient.
44

5-
> Requirements: Java 11
6-
75
## Usage
86

97
### BPMN Task
@@ -80,19 +78,31 @@ A common example is
8078

8179
To allow this, the `jobKey` can be passed to the external service.
8280

83-
8481
## Install
8582

86-
### JAR
83+
### Docker
8784

88-
* Download the [JAR file](https://github.com/zeebe-io/zeebe-http-worker/releases)
89-
* Execute the JAR via
85+
The docker image for the worker is published to [DockerHub](https://hub.docker.com/r/camunda/zeebe-http-worker).
9086

91-
`java -jar target/zeebe-http-worker-{VERSION}.jar`
87+
```
88+
docker pull camunda/zeebe-http-worker:latest
89+
```
90+
* configure the connection to the Zeebe broker by setting `zeebe.client.broker.contactPoint` (default: `localhost:26500`)
9291

93-
### Docker
92+
For a local setup, the repository contains a [docker-compose file](docker/docker-compose.yml). It starts a Zeebe broker and the worker.
93+
94+
```
95+
cd docker
96+
docker-compose up
97+
```
98+
99+
### Manual
100+
101+
1. Download the latest [worker JAR](https://github.com/zeebe-io/zeebe-http-worker/releases) _(zeebe-http-worker-%{VERSION}.jar
102+
)_
94103

95-
`docker run camunda/zeebe-http-worker`
104+
1. Start the worker
105+
`java -jar zeebe-http-worker-{VERSION}.jar`
96106

97107
### Readiness probes
98108

@@ -153,6 +163,12 @@ To change the prefix set these environment variables:
153163
* `LOCAL_ENV_VARS_PREFIX` (default: `"ZEEBE_ENV_"`)
154164
* `LOCAL_ENV_VARS_REMOVE_PREFIX` (default: `true`)
155165

166+
## Build from Source
167+
168+
Build with Maven
169+
170+
`mvn clean install`
171+
156172
## Code of Conduct
157173

158174
This project adheres to the Contributor Covenant [Code of

docker/docker-compose.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: "2"
2+
3+
networks:
4+
zeebe_network:
5+
driver: bridge
6+
7+
services:
8+
zeebe:
9+
container_name: zeebe_broker
10+
image: camunda/zeebe:0.24.1
11+
environment:
12+
- ZEEBE_LOG_LEVEL=debug
13+
ports:
14+
- "26500:26500"
15+
- "9600:9600"
16+
networks:
17+
- zeebe_network
18+
19+
zeebe-http-worker:
20+
container_name: zeebe-http-worker
21+
image: camunda/zeebe-http-worker:latest
22+
environment:
23+
- zeebe.client.broker.contactPoint=zeebe:26500
24+
depends_on:
25+
- zeebe
26+
networks:
27+
- zeebe_network

0 commit comments

Comments
 (0)