-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
73 lines (61 loc) · 2.85 KB
/
Taskfile.yml
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
# https://taskfile.dev
version: "3"
includes:
# fly related tasks
fly-io:
taskfile: ./Taskfile-fly-io.yml
aliases: [f, fly]
optional: true
tasks:
default: mix test --no-start
sh: iex -S mix run --no-start
run: iex -S mix run
# iex -S mix run --no-halt --detached
up: mix bump patch && git push origin main --tag
prel: MIX_ENV=prod mix release --overwrite
prel-tar: MIX_ENV=prod RELEASE_TAR=1 mix release --overwrite
prun: _build/prod/rel/hello_api/bin/hello_api start_iex
redo-deps:
cmds:
- |
mix deps.unlock --all && mix deps.clean --all && mix deps.get
get-info: curl -v http://localhost:4000 | jq
get-user: curl -s http://localhost:4000/users/123
## Git ops
cmt: mix git_ops.release --yes && git push --follow-tags
app-info: mix git_ops.project_info
init-release: mix git_ops.release --initial
## Local prod env in Orbstack
# run `orb` into default ubuntu box(ubox1), then do belows in current project root:
orb-home: curl http://ubox1.orb.local:4000/ | jq
orb-ping: curl http://ubox1.orb.local:4000/ping
orb-run: orb _build/orb-prod/current/bin/hello_api {{.CLI_ARGS}}
orb-pid: task orb-run -- pid
orb-sh: task orb-run -- remote
orb-stop: task orb-run -- stop
# deploy a version from github vsn release, as: task orb-deploy -- v0.1.4 in orb env
orb-deploy: orb _build/orb-prod/deploy.sh {{.CLI_ARGS}}
orb-setup: orb run/setup.sh _build/orb-prod
orb-setup-local: cp run/deploy.sh _build/orb-prod/
## Docker env
# https://hub.docker.com/r/cao7113/hello-api-elixir
# https://github.com/cao7113/hello-api-elixir/pkgs/container/hello-api-elixir
dk-pull-ghcr: docker pull ghcr.io/cao7113/hello-api-elixir
dk-build: docker build -t hello-api-elixir .
dk-run: docker run --name hello-api-elixir --rm -it -p 4000:4000 hello-api-elixir bin/hello_api start_iex
# http://hello-api-elixir.orb.local:4000 or http://localhost:4000
dk-ping: curl http://hello-api-elixir.orb.local | jq
dk-sh: docker run --rm -it hello-api-elixir sh
# cat /etc/os-release or cat /etc/debian_version
## Get images
dk-pull-builder: docker pull hexpm/elixir:1.17.2-erlang-27.0-debian-bullseye-20240701-slim
dk-pull-runner: docker pull debian:bullseye-20240701-slim
# https://github.com/OpenLinkOS/registry-mirrors
get-images: |
docker pull docker.linkos.org/hexpm/elixir:1.17.2-erlang-27.0-debian-bullseye-20240701-slim
docker tag docker.linkos.org/hexpm/elixir:1.17.2-erlang-27.0-debian-bullseye-20240701-slim hexpm/elixir:1.17.2-erlang-27.0-debian-bullseye-20240701-slim
# docker rmi docker.linkos.org/hexpm/elixir:1.17.2-erlang-27.0-debian-bullseye-20240701-slim
docker pull docker.linkos.org/library/debian:bullseye-20240701-slim
docker tag docker.linkos.org/library/debian:bullseye-20240701-slim debian:bullseye-20240701-slim
# Init setup
mk-hello: mix new hello-api-elixir --app hello_api --sup