mirror of
https://github.com/ggogel/seafile-containerized.git
synced 2024-11-16 17:05:32 +00:00
Front-end back-end integration
This commit is contained in:
parent
e6f6d9c2d2
commit
556bbbfb89
|
@ -1,6 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
import json
|
import json
|
||||||
|
import argparse
|
||||||
from os.path import join, exists, dirname
|
from os.path import join, exists, dirname
|
||||||
|
|
||||||
from upgrade import check_upgrade
|
from upgrade import check_upgrade
|
||||||
|
@ -23,7 +24,7 @@ def watch_controller():
|
||||||
print 'seafile controller exited unexpectedly.'
|
print 'seafile controller exited unexpectedly.'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def main():
|
def main(args):
|
||||||
call('/scripts/create_data_links.sh')
|
call('/scripts/create_data_links.sh')
|
||||||
check_upgrade()
|
check_upgrade()
|
||||||
os.chdir(installdir)
|
os.chdir(installdir)
|
||||||
|
@ -41,6 +42,8 @@ def main():
|
||||||
try:
|
try:
|
||||||
call('{} start'.format(get_script('seafile.sh')))
|
call('{} start'.format(get_script('seafile.sh')))
|
||||||
call('{} start'.format(get_script('seahub.sh')))
|
call('{} start'.format(get_script('seahub.sh')))
|
||||||
|
if args.mode == 'backend':
|
||||||
|
call('{} start'.format(get_script('seafile-background-tasks.sh')))
|
||||||
finally:
|
finally:
|
||||||
if exists(password_file):
|
if exists(password_file):
|
||||||
os.unlink(password_file)
|
os.unlink(password_file)
|
||||||
|
@ -53,4 +56,6 @@ def main():
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
parser = argparse.ArgumentParser(description='Seafile cluster start script')
|
||||||
|
parser.add_argument('--mode')
|
||||||
|
main(parser.parse_args())
|
||||||
|
|
|
@ -1,2 +1,18 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
python /scripts/start.py
|
|
||||||
|
function start-front-end() {
|
||||||
|
python /scripts/start.py
|
||||||
|
}
|
||||||
|
|
||||||
|
function start-back-end() {
|
||||||
|
python /scripts/start.py --mode backend
|
||||||
|
}
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
"front-end" )
|
||||||
|
start-front-end
|
||||||
|
;;
|
||||||
|
"back-end" )
|
||||||
|
start-back-end
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
Loading…
Reference in a new issue