Repository navigation
Expand file tree
/
Copy pathbuild_image
More file actions
executable file
·73 lines (64 loc) · 1.57 KB
/
Copy pathbuild_image
File metadata and controls
executable file
·73 lines (64 loc) · 1.57 KB
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
#!/bin/sh
set -e
set -u
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
REPO_DIR=$SCRIPT_DIR
# shellcheck source=tools/build-common.sh
. "${REPO_DIR}/tools/build-common.sh"
# Docker Desktop started to crash when building the image
# podman at least told me installing Crystal with mise ran out of memory
#
# docker build . --tag ai:latest
# check date when it was built with
# podman image inspect ai:latest | jq '.[].Created'
FORCE=0
UPDATE_CLAUDE=0
UPDATE_CODEX=0
UPDATE_ANTIGRAVITY=0
UPDATE_PLUGINS=0
usage () {
echo "Usage: ./build_image [--force] [--update-claude] [--update-codex] [--update-antigravity] [--update-plugins]" >&2
echo " ./build_image [--force] --update-agents" >&2
exit 1
}
for arg in "$@"; do
case "$arg" in
--force)
FORCE=1
;;
--update-claude)
UPDATE_CLAUDE=1
;;
--update-codex)
UPDATE_CODEX=1
;;
--update-antigravity)
UPDATE_ANTIGRAVITY=1
;;
--update-plugins)
UPDATE_PLUGINS=1
;;
--update-agents)
UPDATE_CLAUDE=1
UPDATE_CODEX=1
UPDATE_ANTIGRAVITY=1
UPDATE_PLUGINS=1
;;
-h|--help)
usage
;;
*)
echo "at=fatal msg=\"unknown option\" option=\"$arg\"" >&2
usage
;;
esac
done
[ "$UPDATE_CLAUDE" -eq 1 ] && update_claude_version
[ "$UPDATE_CODEX" -eq 1 ] && update_codex_version
[ "$UPDATE_ANTIGRAVITY" -eq 1 ] && update_antigravity_version
[ "$UPDATE_PLUGINS" -eq 1 ] && update_plugins_versions
set -x
set -- build
[ "$FORCE" -eq 1 ] && set -- "$@" --no-cache --pull
set -- "$@" "$REPO_DIR" --tag ai:latest
podman "$@"