DEVELOPMENT ENVIRONMENT

~liljamo/tixe

ref: 9024ccc11e6acdd0e6c9e3f5d9f3944c0541445c tixe/dev.elv -rwxr-xr-x 790 bytes
9024ccc1Jonni Liljamo feat: docker compose deployment 1 year, 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/elvish

fn run {
    clear
    docker compose up --build
}

fn clean {
    clear
    docker compose down
    docker volume rm tixe_tixedb_data
}

fn docker_menu {
    var input
    while (not-eq $input "b") {
        echo "[R]un, [C]lean, [B]ack"
        set input = (sh -c 'read -n1 && echo $REPLY' | take 1)

        if (eq $input "r") {
            run
        } elif (eq $input "c") {
            clean
        }
    }
}

fn tailwind_watch {
    clear
    tailwindcss -i input.css -o ./static/styles.css --watch
}

var input
while (not-eq $input "q") {
    clear
    echo "[D]ev Deploy, [T]ailwind Watch, [Q]uit"

    set input = (sh -c 'read -n1 && echo $REPLY' | take 1)

    if (eq $input "d") {
        docker_menu
    } elif (eq $input "t") {
        tailwind_watch
    }
}