diff options
| -rw-r--r-- | Justfile | 59 |
1 files changed, 40 insertions, 19 deletions
| @@ -1,3 +1,6 @@ | |||
| 1 | image := 'cr.d464.sh/fct-drive:latest' | ||
| 2 | remote := 'prod' | ||
| 3 | |||
| 1 | _default: | 4 | _default: |
| 2 | just --list | 5 | just --list |
| 3 | 6 | ||
| @@ -19,24 +22,42 @@ logs: | |||
| 19 | tail: | 22 | tail: |
| 20 | demon tail -f dev | 23 | demon tail -f dev |
| 21 | 24 | ||
| 22 | deploy-frontend: build | ||
| 23 | #!/usr/bin/env bash | ||
| 24 | source prod.env | ||
| 25 | cd frontend | ||
| 26 | npm install | ||
| 27 | npm run build | ||
| 28 | npm run start | ||
| 29 | |||
| 30 | deploy-tinyauth: | 25 | deploy-tinyauth: |
| 26 | #!/usr/bin/env bash | ||
| 27 | ssh {{remote}} <<EOF | ||
| 28 | podman stop fctdrive_tinyauth | ||
| 29 | podman rm fctdrive_tinyauth | ||
| 30 | podman run -d --network host \ | ||
| 31 | --name fctdrive_tinyauth \ | ||
| 32 | -e PORT=3001 \ | ||
| 33 | -e APP_URL="https://auth.fctdrive.xyz" \ | ||
| 34 | -e SECRET=$(openssl rand -hex 16) \ | ||
| 35 | -e OAUTH_AUTO_REDIRECT="google" \ | ||
| 36 | -e GOOGLE_CLIENT_ID=$(pass google.com/fct-drive/oauth-client-id) \ | ||
| 37 | -e GOOGLE_CLIENT_SECRET=$(pass google.com/fct-drive/oauth-client-secret) \ | ||
| 38 | ghcr.io/steveiliop56/tinyauth:v3 | ||
| 39 | EOF | ||
| 40 | |||
| 41 | deploy-frontend: push-container | ||
| 31 | #!/usr/bin/env bash | 42 | #!/usr/bin/env bash |
| 32 | source prod.env | 43 | # sudo mount.cifs -o uid=1000,gid=1000,username=u484453 //u484453.your-storagebox.de/backup fct-drive |
| 33 | podman run --rm -i \ | 44 | ssh {{remote}} <<EOF |
| 34 | --name tinyauth \ | 45 | podman stop fctdrive_frontend |
| 35 | --network host \ | 46 | podman rm fctdrive_frontend |
| 36 | -e PORT=3001 \ | 47 | podman run -td --network host \ |
| 37 | -e SECRET="$TINYAUTH_SECRET" \ | 48 | --name fctdrive_frontend \ |
| 38 | -e APP_URL="$TINYAUTH_APP_URL" \ | 49 | -e PORT=3000 \ |
| 39 | -e USERS="$TINYAUTH_USERS" \ | 50 | -e FCTDRIVE_PATH=/data \ |
| 40 | -e GOOGLE_CLIENT_ID="$GOOGLE_CLIENT_ID" \ | 51 | -e TINYAUTH_ENDPOINT="http://127.0.0.1:3001" \ |
| 41 | -e GOOGLE_CLIENT_SECRET="$GOOGLE_CLIENT_SECRET" \ | 52 | -e TINYAUTH_PUBLIC_ENDPOINT="https://auth.fctdrive.xyz" \ |
| 42 | ghcr.io/steveiliop56/tinyauth:v3 | 53 | -v /home/diogo464/fct-drive:/data \ |
| 54 | --pull=always \ | ||
| 55 | {{image}} | ||
| 56 | EOF | ||
| 57 | |||
| 58 | build-container: build | ||
| 59 | cd frontend && npm run build | ||
| 60 | podman build -t {{image}} . | ||
| 61 | |||
| 62 | push-container: build-container | ||
| 63 | podman push {{image}} | ||
