Commit 243e2b4e authored by kalvin's avatar kalvin

rabbitmq-syncer

parent 993f1cce
FROM 192.168.4.36/baseimg/busybox
USER root
WORKDIR /home/quant_group
COPY docker-entrypoint.sh .
RUN chmod +x ./docker-entrypoint.sh
CMD ["./docker-entrypoint.sh"]
\ No newline at end of file
#!/bin/bash
USER='qa'
PASSWORD='qatest'
count=1
is_running=0
until [[ $count -eq 60 ]] || [[ $is_running -eq 1 ]]
do
let count+=1
echo "count is $count"
curl -X GET -H "Authorization: Basic cWE6cWF0ZXN0" "http://rabbitmq:15672/api/definitions"
if [ $? -eq 0 ]
then
echo "rabbitmq is running"
is_running=1
else
echo "rabbitmq is not running"
sleep 1
fi
done
if [[ $is_running -eq 1 ]]
then
echo "rabbitmq is running!!! start execution sync job"
echo "get definitions from 172.16.1.231"
response=$(curl -X GET -H "Authorization: Basic cmFiYml0X2FkbWluOmFiYzEyMzQ=" "http://172.16.1.231:15672/api/definitions")
curl -X POST -H "Content-Type: application/json" -H "Authorization: Basic cWE6cWF0ZXN0" -d $response "http://rabbitmq:15672/api/definitions"
else
echo "rabbitmq is not running!!! Do not execution replace job"
fi
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment