Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
zmaplex committed Mar 30, 2023
1 parent bb1c2d6 commit 28b8b5f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test install
name: Deployment CI

on:
push:
Expand All @@ -9,7 +9,7 @@ on:
jobs:
install-debian:
runs-on: ubuntu-22.04
name: Test install backend on Debian 11
name: on Debian 11
steps:
- name: Test run server
uses: UISSH/install-script@latest
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/ubuntu_22.04.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Deployment CI

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
install-ubuntu:
runs-on: ubuntu-22.04
name: on Ubuntu 22.04
steps:
- uses: actions/checkout@v3
- name: Init
run: sudo bash install.sh
- name: Deploy
run: |
cd /tmp/install-script && \
sudo python3 main.py --login_email=root@root.com --db_root_password=root --login_password=root
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ def install_backend():

# download & install frontend
cmd(f'cd {BACKEND_DIR}/static && wget -q {FRONTEND_URL} -O "django_spa.zip" && rm -rf common spa', 'Download frontend')
cmd(f'cd {BACKEND_DIR}/static && unzip django_spa.zip', 'Unzip frontend')
cmd(f'cd {BACKEND_DIR}/static && unzip django_spa.zip > /dev/null',
'Unzip frontend')
cmd(f'cd {BACKEND_DIR}/static && mv django_spa common')
cmd(f'cd {PROJECT_DIR} && rm -rf backend-release-* *.zip', 'Clean...')

Expand Down
13 changes: 8 additions & 5 deletions src/phpmyadmin/phpmyadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def d_print(*args, **kwargs):
print(*args, **kwargs)


def install_phpmyadmin() -> (bytes, bytes):
def install_phpmyadmin():
"""
https://nginx.org/en/linux_packages.html#Debian
"""
Expand All @@ -210,7 +210,7 @@ def install_phpmyadmin() -> (bytes, bytes):
# """
_cmd = f"""
wget -q https://files.phpmyadmin.net/phpMyAdmin/{phpmyadmin_version}/phpMyAdmin-{phpmyadmin_version}-all-languages.tar.gz
tar -zxvf phpMyAdmin-{phpmyadmin_version}-all-languages.tar.gz >> /dev/null
tar -zxvf phpMyAdmin-{phpmyadmin_version}-all-languages.tar.gz > /dev/null
mv phpMyAdmin-{phpmyadmin_version}-all-languages /usr/share/phpMyAdmin
"""
Expand Down Expand Up @@ -284,14 +284,18 @@ def install_phpmyadmin() -> (bytes, bytes):
chmod 777 /usr/share/phpMyAdmin/tmp
chown -R www-data:www-data /usr/share/phpMyAdmin
systemctl restart nginx
systemctl restart php7.4-fpm
"""
os.system(_cmd_2)

php_version = os.popen('php -v').read().split(' ')[1].split('.')[:2]
php_version = ".".join(php_version)
php_fpm = f'php{php_version}-fpm'
os.system(f'systemctl restart {php_fpm}')

return b"\nok", b" "


def cmd(run_cmd) -> (bytes, bytes):
def cmd(run_cmd):
if callable(run_cmd):
out = run_cmd()
return out
Expand All @@ -313,7 +317,6 @@ def test():
_result = f"\n[red]{soft_name} installed failed![/red]"
print(_result)
exit(1)
return False


dependents = "php-json php-mbstring php-xml"
Expand Down

0 comments on commit 28b8b5f

Please sign in to comment.