Skip to content

Commit

Permalink
tries fixing issues with plantuml installation
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangFahl committed May 1, 2023
1 parent 92d90dd commit b2ddc52
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion profiwiki/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__="0.1.5"
__version__="0.1.6"
30 changes: 23 additions & 7 deletions profiwiki/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,30 @@ def install_plantuml(self):
"""
install plantuml to this container
"""
script="""#!/bin/bash
# install plantuml
# WF 2023-05-01
apt-get update
apt-get install -y plantuml
"""
# https://gabrieldemarmiesse.github.io/python-on-whales/docker_objects/containers/
self.dc.container.execute(["apt-get","update"],tty=True)
self.dc.container.execute(["apt-get","install","-y","plantuml"],tty=True)
script_path="/root/install_plantuml.sh"
self.install_and_run_script(script, script_path)
pass

def install_and_run_script(self,script:str,script_path:str):
"""
install and run the given script
Args:
script(str): the source code of the script
script_path(str): the path to copy the script to and then execute
"""
self.upload(script,script_path)
# make executable
self.dc.container.execute(["chmod","+x",script_path])
self.dc.container.execute([script_path],tty=True)

def install_fontawesome(self):
"""
install fontawesome to this container
Expand Down Expand Up @@ -98,14 +117,11 @@ def install_fontawesome(self):
a2enconf font-awesome
"""
script_path="/root/install_fontawesome"
self.upload(script,"/root/install_fontawesome")
# make executable
self.dc.container.execute(["chmod","+x",script_path])
self.dc.container.execute([script_path],tty=True)
self.install_and_run_script(script, script_path)
try:
self.dc.container.execute(["service","apache2","restart"])
except DockerException as e:
# we expect a SIGTERM
if not e.return_code==143:
raise e
pass
pass

0 comments on commit b2ddc52

Please sign in to comment.