update
This commit is contained in:
parent
2c8efa8c10
commit
bbe9e0eb0e
1 changed files with 10 additions and 9 deletions
19
deploy.py
19
deploy.py
|
@ -1,5 +1,6 @@
|
||||||
from pyinfra import host
|
from pyinfra import host
|
||||||
from pyinfra.operations import apt, server, files, systemd
|
from pyinfra.operations import apt, server, files, systemd
|
||||||
|
from pyinfra.facts.files import File, Directory
|
||||||
|
|
||||||
SUDO = True
|
SUDO = True
|
||||||
|
|
||||||
|
@ -12,13 +13,13 @@ server.user(
|
||||||
present=True,
|
present=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
apt.update(
|
#apt.update(
|
||||||
name='Update apt repositories',
|
# name='Update apt repositories',
|
||||||
)
|
#)
|
||||||
|
#
|
||||||
apt.upgrade(
|
#apt.upgrade(
|
||||||
name='Upgrade apt packages',
|
# name='Upgrade apt packages',
|
||||||
)
|
#)
|
||||||
|
|
||||||
# Disabled because need to deal with Oracle pre-set rules =_=
|
# Disabled because need to deal with Oracle pre-set rules =_=
|
||||||
#apt.packages(
|
#apt.packages(
|
||||||
|
@ -66,7 +67,7 @@ files.download(
|
||||||
cache_time=604800,
|
cache_time=604800,
|
||||||
)
|
)
|
||||||
|
|
||||||
if not host.fact.file('/tmp/uptime-kuma.tar'):
|
if not host.get_fact(File, '/tmp/uptime-kuma.tar'):
|
||||||
server.shell(
|
server.shell(
|
||||||
name='Download uptime-kuma',
|
name='Download uptime-kuma',
|
||||||
chdir='/tmp',
|
chdir='/tmp',
|
||||||
|
@ -81,7 +82,7 @@ files.directory(
|
||||||
mode=755
|
mode=755
|
||||||
)
|
)
|
||||||
|
|
||||||
if not host.fact.directory('/opt/uptime-kuma/app'):
|
if not host.get_fact(Directory,'/opt/uptime-kuma/app'):
|
||||||
server.shell(
|
server.shell(
|
||||||
name='Undocker the app',
|
name='Undocker the app',
|
||||||
chdir='/opt/uptime-kuma',
|
chdir='/opt/uptime-kuma',
|
||||||
|
|
Reference in a new issue