-
Notifications
You must be signed in to change notification settings - Fork 49
54 lines (49 loc) · 2.33 KB
/
maven-package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
name: Redis runner example
on:
pull_request:
types: [ opened, reopened, synchronize ]
release:
types: [ created ]
jobs:
# Label of the runner job
runner-job:
# You must use a Linux environment when using service containers or container jobs
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
# Downloads a copy of the code in your repository before running CI tests
- name: Create RocketMQ container
run: |
docker pull apache/rocketmq:5.1.0
echo 'brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
autoCreateTopicEnable = true
autoCreateSubscriptionGroup = true
brokerIP1 =127.0.0.1'>>/opt/broker.conf
docker run -d --name rmqnamesrv -p 9876:9876 apache/rocketmq:5.1.0 sh mqnamesrv autoCreateTopicEnable=true
docker run -d --name rmqbroker -p 10911:10911 -p 10909:10909 --link rmqnamesrv:namesrv -v /opt/broker.conf:/opt/rocketmq-5.1.0/conf/broker.conf -e "NAMESRV_ADDR=rmqnamesrv:9876" apache/rocketmq:5.1.0 sh mqbroker autoCreateTopicEnable=true -c /opt/rocketmq-5.1.0/conf/broker.conf
- name: Wait for RocketMQ namesrv container to be ready
run: |
docker exec rmqnamesrv sh -c 'while ! nc -z localhost 9876; do sleep 1; done'
- name: Wait for RocketMQ broker container to be ready
run: |
docker exec rmqbroker sh -c 'while ! nc -z localhost 10911; do sleep 1; done'
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Build with Maven
run: mvn -B package --file pom.xml