blis-cloud-cli 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- blis_cli/__init__.py +0 -0
- blis_cli/blis.py +67 -0
- blis_cli/commands/__init__.py +0 -0
- blis_cli/commands/docker.py +139 -0
- blis_cli/commands/domain.py +144 -0
- blis_cli/commands/install.py +92 -0
- blis_cli/commands/logs.py +73 -0
- blis_cli/commands/start.py +13 -0
- blis_cli/commands/status.py +78 -0
- blis_cli/commands/stop.py +18 -0
- blis_cli/commands/swap.py +50 -0
- blis_cli/commands/update.py +37 -0
- blis_cli/extra/docker-compose.yml +57 -0
- blis_cli/extra/dump-blis_12-202202091919.sql +1539 -0
- blis_cli/extra/dump-blis_127-202202091919.sql +1604 -0
- blis_cli/extra/dump-blis_revamp-20220704.sql +1644 -0
- blis_cli/extra/templates/Caddyfile.j2 +22 -0
- blis_cli/util/__init__.py +1 -0
- blis_cli/util/bash.py +25 -0
- blis_cli/util/caddy.py +63 -0
- blis_cli/util/config.py +159 -0
- blis_cli/util/docker_util.py +118 -0
- blis_cli/util/environment.py +35 -0
- blis_cli/util/packages.py +26 -0
- blis_cloud_cli-0.1.1.dist-info/LICENSE +21 -0
- blis_cloud_cli-0.1.1.dist-info/METADATA +31 -0
- blis_cloud_cli-0.1.1.dist-info/RECORD +29 -0
- blis_cloud_cli-0.1.1.dist-info/WHEEL +4 -0
- blis_cloud_cli-0.1.1.dist-info/entry_points.txt +3 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import click
|
|
2
|
+
import docker
|
|
3
|
+
|
|
4
|
+
from blis_cli.util import bash
|
|
5
|
+
from blis_cli.util import caddy
|
|
6
|
+
from blis_cli.util import config
|
|
7
|
+
from blis_cli.util import docker_util
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def run():
|
|
11
|
+
restart_blis = False
|
|
12
|
+
if docker_util.blis_is_running():
|
|
13
|
+
if not docker_util.stop_blis_with_confirm():
|
|
14
|
+
return 1
|
|
15
|
+
restart_blis = True
|
|
16
|
+
|
|
17
|
+
click.echo("Updating BLIS... ", nl=False)
|
|
18
|
+
out, err = bash.run(f"{docker_util.compose()} -f {config.compose_file()} pull app")
|
|
19
|
+
if err:
|
|
20
|
+
click.secho("Failed", fg="red")
|
|
21
|
+
click.echo(err, err=True)
|
|
22
|
+
return 1
|
|
23
|
+
click.secho("Success!", fg="green")
|
|
24
|
+
|
|
25
|
+
if not caddy.installed():
|
|
26
|
+
click.echo("Installing Caddy... ", nl=False)
|
|
27
|
+
try:
|
|
28
|
+
caddy.install()
|
|
29
|
+
click.secho("Success!", fg="green")
|
|
30
|
+
except Exception as e:
|
|
31
|
+
click.secho(e, fg="red")
|
|
32
|
+
return 1
|
|
33
|
+
|
|
34
|
+
if restart_blis:
|
|
35
|
+
return docker_util.start_blis("app")
|
|
36
|
+
|
|
37
|
+
return 0
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
version: '3'
|
|
2
|
+
|
|
3
|
+
#####
|
|
4
|
+
# This file is an example docker-compose file for deploying BLIS to a cloud provider
|
|
5
|
+
# This file is used as a template, but will be rewritten by the BLIS tool as necessary.
|
|
6
|
+
|
|
7
|
+
name: c4gblis
|
|
8
|
+
|
|
9
|
+
services:
|
|
10
|
+
caddy:
|
|
11
|
+
image: caddy:2
|
|
12
|
+
restart: unless-stopped
|
|
13
|
+
cap_add:
|
|
14
|
+
- NET_ADMIN
|
|
15
|
+
ports:
|
|
16
|
+
- "80:80"
|
|
17
|
+
- "443:443"
|
|
18
|
+
- "443:443/udp"
|
|
19
|
+
volumes:
|
|
20
|
+
- ./Caddyfile:/etc/caddy/Caddyfile
|
|
21
|
+
- caddy_data:/data
|
|
22
|
+
- caddy_config:/config
|
|
23
|
+
|
|
24
|
+
app:
|
|
25
|
+
image: "ghcr.io/c4g/blis:latest"
|
|
26
|
+
restart: unless-stopped
|
|
27
|
+
environment:
|
|
28
|
+
DB_HOST: 'db'
|
|
29
|
+
DB_PORT: '3306'
|
|
30
|
+
DB_USER: 'root'
|
|
31
|
+
DB_PASS: 'blis123'
|
|
32
|
+
depends_on:
|
|
33
|
+
- caddy
|
|
34
|
+
- db
|
|
35
|
+
volumes:
|
|
36
|
+
- blis-files:/var/www/blis/files
|
|
37
|
+
- blis-logs:/var/www/blis/log
|
|
38
|
+
|
|
39
|
+
db:
|
|
40
|
+
image: mysql:5.7
|
|
41
|
+
command: --default-authentication-plugin=mysql_native_password --innodb-strict-mode=OFF --sql-mode=""
|
|
42
|
+
restart: unless-stopped
|
|
43
|
+
volumes:
|
|
44
|
+
- blis-mysql:/var/lib/mysql
|
|
45
|
+
environment:
|
|
46
|
+
MYSQL_ROOT_PASSWORD: blis123
|
|
47
|
+
healthcheck:
|
|
48
|
+
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost", "-uroot", "-pblis123"]
|
|
49
|
+
timeout: 20s
|
|
50
|
+
retries: 10
|
|
51
|
+
|
|
52
|
+
volumes:
|
|
53
|
+
blis-files:
|
|
54
|
+
blis-logs:
|
|
55
|
+
blis-mysql:
|
|
56
|
+
caddy_data:
|
|
57
|
+
caddy_config:
|