-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
99 lines (76 loc) · 2.75 KB
/
justfile
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# https://just.systems/man/en/chapter_36.html
set dotenv-load
list:
just --list
install:
npm install -g @ionic/cli @angular/cli
brew install supabase/tap/supabase
brew update
brew install supabase poetry [email protected]
@init_shell:
if ! grep -q 'Homebrew' ~/.zshrc; then \
echo '\n# Set PATH, MANPATH, etc., for Homebrew.' >> ~/.zshrc; \
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.zshrc; \
echo '\n# NVM \nexport NVM_DIR="$HOME/.nvm"' >> ~/.zshrc; \
echo '[ -s "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" ] && \. "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" # This laods nvm' >> ~/.zshrc; \
echo '\n# Starship \neval "$(starship init zsh)"' >> ~/.zshrc; \
fi
init_devcontainer:
sudo chown -R $(whoami) /home/vscode/.nvm
sudo chown -R $(whoami) /home/linuxbrew/.linuxbrew
mkdir -p /home/vscode/.cache
sudo chown -R $(whoami) /home/vscode/.cache
just init_shell
update:
sudo apt update && sudo apt -y full-upgrade
brew update && brew upgrade
### Docker Operations
docker-build:
# https://docs.github.com/en/packages/learn-github-packages/about-permissions-for-github-packages
docker build . -f ./.devcontainer/Dockerfile -t devcontainer-core --squash --compress
@op run --no-masking --env-file="./.env" -- printenv GITHUB_TOKEN | docker login ghcr.io -u gethub --password-stdin
docker image tag devcontainer-core ghcr.io/getglad/devcontainer-core:latest
docker push ghcr.io/getglad/devcontainer-core:latest
###
# OP
# eval $(op signin)
###
op_signin:
eval $(op signin)
add_cred $title $username $credential:
op item create --vault devTool --category apicredential --title $title username=$username credential=$credential
add_github:
op run --no-masking --env-file="./.env" -- printenv DEPLOY_KEY | cat > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
eval "$(ssh-agent -s)" && ssh-add ~/.ssh/id_rsa
###
# supabase
#
###
update_supabase_config:
op inject -i ./supabase/config.toml.tpl -o ./supabase/config.toml
refresh_supabase: update_supabase_config
supabase stop
supabase start
update_env:
rm .env
cp .env.tpl .env
supabase status -o env >> .env
###
# web app
###
update_web_app_prod:
op inject -i ./app/tpl/environment.ts.tpl -o ./app/src/environments/environment.ts.tpl
envsubst < ./app/src/environments/environment.ts.tpl > ./app/src/environments/environment.ts
rm ./app/src/environments/environment.ts.tpl
update_web_app: update_env
envsubst < ./app/tpl/environment.ts.dev.tpl > ./app/src/environments/environment.ts
serve: update_supabase_config update_web_app
cd app && npm run start
###
# mobile
###
mo-init:
cd ./app && ionic cap add android
mo-build:
cd ./app && ionic cap sync