This repository was archived by the owner on Aug 12, 2020. It is now read-only.
File tree 5 files changed +59
-16
lines changed
5 files changed +59
-16
lines changed Original file line number Diff line number Diff line change 18
18
run : |
19
19
docker build --build-arg VERSION=$RABBITMQ_VERSION --file Dockerfile.windows --tag exivity/rabbitmq:$RABBITMQ_VERSION .
20
20
docker tag exivity/rabbitmq:$RABBITMQ_VERSION exivity/rabbitmq:latest
21
+ - name : test
22
+ run : test.sh
21
23
- name : login
22
24
run : echo $GITHUB_TOKEN | docker login -u $DOCKER_HUB_USER --password-stdin
23
25
env :
Original file line number Diff line number Diff line change @@ -16,14 +16,15 @@ RUN curl ('https://github.com/rabbitmq/rabbitmq-server/releases/download/v{0}/ra
16
16
ENV RABBITMQ_SERVER="C:\Program Files\RabbitMQ Server\rabbitmq_server-${VERSION}"
17
17
18
18
ENV RABBITMQ_CONFIG_FILE="c:\rabbitmq"
19
- COPY rabbitmq.config C:/
20
- COPY rabbitmq.config C:/Users/ContainerAdministrator/AppData/Roaming/RabbitMQ/
19
+ COPY healthcheck.cmd C:/
21
20
COPY enabled_plugins C:/Users/ContainerAdministrator/AppData/Roaming/RabbitMQ/
22
21
23
22
EXPOSE 4369
24
- EXPOSE 5672
25
23
EXPOSE 5671
24
+ EXPOSE 5672
26
25
EXPOSE 15672
27
26
27
+ HEALTHCHECK --interval=5s --timeout=60s CMD C:/healthcheck.cmd
28
+
28
29
WORKDIR C:/Program\ Files/RabbitMQ\ Server/rabbitmq_server-${VERSION}/sbin
29
30
CMD .\rabbitmq-server.bat
Original file line number Diff line number Diff line change
1
+ curl --connect-timeout 5 --max-time 60 --retry 1 --user guest:guest http://localhost:15672/api/healthchecks/node
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ healthy=healthy
4
+
5
+ # https://gist.github.com/sj26/88e1c6584397bb7c13bd11108a579746
6
+ function retry {
7
+ local retries=$1
8
+ shift
9
+
10
+ local count=0
11
+ until " $@ " ; do
12
+ exit=$?
13
+ wait=$(( 2 ** $count ))
14
+ count=$(( $count + 1 ))
15
+ if [ $count -lt $retries ]; then
16
+ echo " Retry $count /$retries exited $exit , retrying in $wait seconds..."
17
+ sleep $wait
18
+ else
19
+ echo " Retry $count /$retries exited $exit , no more retries left."
20
+ return $exit
21
+ fi
22
+ done
23
+ return 0
24
+ }
25
+
26
+ function health {
27
+ docker inspect --format=' {{json .State.Health.Status}}' rabbitmq
28
+ }
29
+
30
+ function test {
31
+ status=` health`
32
+
33
+ echo " Got status $status "
34
+
35
+ [ $status = " \" $healthy \" " ]
36
+ }
37
+
38
+ set -e
39
+
40
+ docker run \
41
+ --rm \
42
+ --detach \
43
+ -p 4369:4369 \
44
+ -p 5671:5671 \
45
+ -p 5672:5672 \
46
+ -p 15672:15672 \
47
+ --name rabbitmq \
48
+ exivity/rabbitmq:latest
49
+
50
+ retry 10 test
51
+
52
+ docker stop rabbitmq
You can’t perform that action at this time.
0 commit comments