Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qg-dockerfiles
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
qg-dockerfiles
Commits
6f6195c1
Commit
6f6195c1
authored
Mar 28, 2018
by
wentao.suo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit rabbitmq sh
parent
90ced6c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
46 deletions
+36
-46
docker-entrypoint.sh
baseimg/tools/rabbit_mq/scripts/docker-entrypoint.sh
+36
-46
No files found.
baseimg/tools/rabbit_mq/scripts/docker-entrypoint.sh
View file @
6f6195c1
...
@@ -16,55 +16,45 @@ nohup /usr/sbin/rabbitmq-server > /tmp/rabbitmq.out &
...
@@ -16,55 +16,45 @@ nohup /usr/sbin/rabbitmq-server > /tmp/rabbitmq.out &
export
NAMESPACE
=
`
cat
/var/run/secrets/kubernetes.io/serviceaccount/namespace
`
export
NAMESPACE
=
`
cat
/var/run/secrets/kubernetes.io/serviceaccount/namespace
`
count
=
1
count
=
1
until
[[
$count
-eq
300
]]
||
[[
$is_running
-eq
1
]]
is_running
=
0
until
[[
is_running
-eq
1
]]
do
do
let
count+
=
1
echo
"wait rabbitmq start flag"
echo
"count is
$count
"
num
=
`
grep
-n
-E
'Server startup complete'
/tmp/rabbitmq.out |cut
-d
":"
-f
1
`
curl
-X
GET
-H
"Authorization: Basic cWE6cWF0ZXN0"
"http://localhost:15672/api/definitions"
echo
"----
$num
"
if
[
-n
"
$num
"
]
;
then
if
[
$?
-eq
0
]
is_running
=
1
then
break
echo
"rabbitmq is running rabbitmq-plugins enable rabbitmq_delayed_message_exchange"
fi
rabbitmq-plugins
enable
rabbitmq_delayed_message_exchange
sleep
10
curl
--request
POST
\
--url
http://192.168.6.13/api/etcd/set_env_job_status
\
--header
'Content-Type: application/json'
\
--data
"{
\"
namespace
\"
:
\"
$NAMESPACE
\"
,
\"
job_name
\"
:
\"
rabbitmq_sync
\"
,
\"
status
\"
:
\"
pending
\"
}"
# wailt rabbitmq start
for
((
i
=
0
;;
))
do
num
=
`
grep
-n
-E
'Server startup complete'
/tmp/rabbitmq.out |cut
-d
":"
-f
1
`
if
[
-n
"
$num
"
]
;
then
is_running
=
1
break
fi
sleep
10
done
if
[[
$is_running
-eq
1
]]
then
echo
"rabbitmq is running!!! start execution sync job"
echo
"init rabbit with eos server"
response
=
$(
curl
-X
POST
-H
"Content-Type: application/json"
-d
"{
\"
namespace
\"
:
\"
$NAMESPACE
\"
}"
"http://192.168.6.13/api/etcd/init_env_rabbitmq_config"
)
echo
$response
else
echo
"rabbitmq is not running!!! Do not execution sync job"
fi
curl
--request
POST
\
--url
http://192.168.6.13/api/etcd/set_env_job_status
\
--header
'Content-Type: application/json'
\
--data
"{
\"
namespace
\"
:
\"
$NAMESPACE
\"
,
\"
job_name
\"
:
\"
rabbitmq_sync
\"
,
\"
status
\"
:
\"
done
\"
}"
tail
-f
/tmp/rabbitmq.out
else
echo
"rabbitmq is not running"
sleep
1
fi
done
done
echo
"wait 5s"
sleep
5
rabbitmq-plugins
enable
rabbitmq_delayed_message_exchange
curl
--request
POST
\
--url
http://192.168.6.13/api/etcd/set_env_job_status
\
--header
'Content-Type: application/json'
\
--data
"{
\"
namespace
\"
:
\"
$NAMESPACE
\"
,
\"
job_name
\"
:
\"
rabbitmq_sync
\"
,
\"
status
\"
:
\"
pending
\"
}"
response
=
$(
curl
-X
POST
-H
"Content-Type: application/json"
-d
"{
\"
namespace
\"
:
\"
$NAMESPACE
\"
}"
"http://192.168.6.13/api/etcd/init_env_rabbitmq_config"
)
echo
$response
curl
--request
POST
\
--url
http://192.168.6.13/api/etcd/set_env_job_status
\
--header
'Content-Type: application/json'
\
--data
"{
\"
namespace
\"
:
\"
$NAMESPACE
\"
,
\"
job_name
\"
:
\"
rabbitmq_sync
\"
,
\"
status
\"
:
\"
done
\"
}"
tail
-f
/tmp/rabbitmq.out
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment