Skip to content

Commit 59987a4

Browse files
committed
[feat]: docker build action
1 parent 181279e commit 59987a4

File tree

9 files changed

+113
-6
lines changed

9 files changed

+113
-6
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Update Docker Hub Description
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- README.md
9+
- .github/workflows/dockerhub-description.yml
10+
env:
11+
# <repo>
12+
IMAGE_NAME: ${{ github.event.repository.name }}-server
13+
jobs:
14+
dockerHubDescription:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Docker Hub Description
20+
uses: peter-evans/dockerhub-description@v3
21+
with:
22+
username: ${{ secrets.DOCKER_HUB_USER }}
23+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
24+
repository: ${{ secrets.DOCKER_HUB_USER }}/${{ env.IMAGE_NAME }}
25+
short-description: ${{ github.event.repository.description }}
26+
enable-url-completion: true
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Lingo Server Docker Latest
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
env:
8+
# <repo>
9+
IMAGE_NAME: ${{ github.event.repository.name }}-server
10+
PLATFORMS: linux/amd64,linux/arm64
11+
jobs:
12+
push_to_registry:
13+
name: Push Docker image to Docker Hub
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
node-version: [18.x]
18+
steps:
19+
- name: Check out code
20+
uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 1
23+
- name: Set up QEMU
24+
uses: docker/setup-qemu-action@v2
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v2
27+
with:
28+
driver-opts: network=host
29+
- name: Docker meta
30+
id: meta
31+
uses: docker/metadata-action@v4
32+
with:
33+
images: ${{ secrets.DOCKER_HUB_USER }}/${{ env.IMAGE_NAME }}
34+
tags: |
35+
# set latest tag for main branch
36+
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
37+
38+
- name: Login to Docker Hub
39+
uses: docker/login-action@v2
40+
with:
41+
username: ${{ secrets.DOCKER_HUB_USER }}
42+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
43+
- name: Build and push
44+
uses: docker/build-push-action@v4
45+
with:
46+
push: true
47+
platforms: ${{ env.PLATFORMS }}
48+
tags: ${{ steps.meta.outputs.tags }}
49+
labels: ${{ steps.meta.outputs.labels }}
50+
file: Dockerfile
51+
context: .

.github/workflows/lingo_build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
uses: actions/checkout@v3
1414
with:
1515
fetch-depth: 1
16-
- name: Set up JDK 11
16+
- name: Set up JDK 17
1717
uses: actions/setup-java@v3
1818
with:
1919
distribution: 'zulu' # See 'Supported distributions' for available options
20-
java-version: '11'
20+
java-version: '17'
2121
cache: 'maven'
2222
- name: Cache mvn dependencies
2323
uses: actions/cache@v3

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# Build stage
3+
#
4+
FROM maven:3.9.3-eclipse-temurin-17-focal AS builder
5+
WORKDIR /lingo_workspace
6+
# Copy src code
7+
COPY . .
8+
RUN mvn clean package -DskipTests
9+
10+
#
11+
# Package stage
12+
#
13+
FROM openjdk:17-jdk-slim-buster
14+
WORKDIR /lingo-server
15+
16+
COPY --from=builder /lingo_workspace/lingo-server/target/lingo-server.jar .
17+
18+
ENTRYPOINT ["java", "-jar","lingo-server.jar"]

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
# lingo
1+
# lingo
2+
3+
A lightweight tool for building observability pipelines

lingo-common/src/test/java/io/lindb/lingo/common/queue/FanOutQueueTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void consumeGroup() throws Exception {
5858
});
5959
producer.start();
6060

61-
Thread.sleep(60000);
61+
Thread.sleep(10000);
6262
running.set(false);
6363
}
6464
}

lingo-runtime/src/test/java/io/lindb/lingo/runtime/pipeline/PipelineRunnerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ public class PipelineRunnerTest {
1111
public void run() throws Exception {
1212
PipelineRunner.run("a.yml");
1313
// PipelineRunner.run("c.yml");
14-
Thread.sleep(100000);
14+
Thread.sleep(10000);
1515
}
1616
}

lingo-server/pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@
3737
<plugin>
3838
<groupId>org.springframework.boot</groupId>
3939
<artifactId>spring-boot-maven-plugin</artifactId>
40-
<version>2.7.5</version>
40+
<executions>
41+
<execution>
42+
<goals>
43+
<goal>repackage</goal>
44+
</goals>
45+
</execution>
46+
</executions>
4147
</plugin>
4248
</plugins>
4349
</build>

pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@
163163
<target>1.8</target>
164164
</configuration>
165165
</plugin>
166+
<plugin>
167+
<groupId>org.springframework.boot</groupId>
168+
<artifactId>spring-boot-maven-plugin</artifactId>
169+
</plugin>
166170
</plugins>
167171
</pluginManagement>
168172
</build>

0 commit comments

Comments
 (0)