Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
EOLE
Zéphir
Services
Server Manager
Commits
23b99e2d
Commit
23b99e2d
authored
Mar 07, 2019
by
Bruno Boiget
Browse files
Merge branch '57_exec_deploy' into 'develop'
fix_#57 exec deploy See merge request
!6
parents
47af9156
eb34e4e2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
23b99e2d
...
...
@@ -38,7 +38,7 @@ RUN git clone "${CONTAINERPILOT_REPO_URL}" "/tmp/orchestrate" \
# API messages description
ARG
MESSAGES_API_REPO_URL=https://gitlab.mim.ovh/EOLE/Zephir/messages-api.git
ARG
MESSAGES_API_REPO_REF=0.0.
4
-dev
ARG
MESSAGES_API_REPO_REF=0.0.
5
-dev
RUN
git clone
"
${
MESSAGES_API_REPO_URL
}
"
"/tmp/messages-api"
\
&&
cd
/tmp/messages-api
\
...
...
scripts/controller
View file @
23b99e2d
...
...
@@ -245,6 +245,9 @@ class ServerRunner(ZephirCommonController):
@
register_wamp
(
'v1.server.exec.deploy'
,
notification_uri
=
None
,
database
=
True
)
async
def
exec_deploy
(
self
,
cursor
,
server_id
):
return
await
self
.
_exec_deploy_on_server
(
cursor
,
server_id
)
async
def
_exec_deploy_on_server
(
self
,
cursor
,
server_id
):
automation
,
automation_command
=
self
.
server
.
get_automation_command
(
cursor
,
server_id
)
if
automation
==
'salt'
:
result
=
await
self
.
call
(
'v1.execution.salt.configuration.deploy'
,
...
...
@@ -546,6 +549,24 @@ class ServerRunner(ZephirCommonController):
'return'
:
str
(
err
)})
return
ret
@
register_wamp
(
'v1.serverselection.exec.deploy'
,
notification_uri
=
None
,
database
=
True
)
#FIXME notification
async
def
exec_deploy_on_serverserverselection
(
self
,
cursor
,
serverselection_id
):
"""
Transfer command transmitted to automation (salt, ...)
"""
servers
=
self
.
serverselection
.
describe_serverselection
(
cursor
,
serverselection_id
)[
'serverselectionserversid'
]
ret
=
[]
for
server_id
in
servers
:
try
:
ret
.
append
(
await
self
.
_exec_deploy_on_server
(
cursor
,
server_id
))
except
ServerErrorUnknownServerId
as
err
:
ret
.
append
({
'job_id'
:
''
,
'server_id'
:
server_id
,
'command'
:
'deploy'
,
'automation'
:
'salt'
,
'executed'
:
False
})
return
ret
if
__name__
==
'__main__'
:
run
(
ServerRunner
)
...
...
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