forked from LostArtefacts/TRX
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
89 lines (71 loc) · 2.66 KB
/
justfile
File metadata and controls
89 lines (71 loc) · 2.66 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
CWD := `pwd`
HOST_USER_UID := `id -u`
HOST_USER_GID := `id -g`
DOCKER_IMAGE_VERSION := "20251017.rev1"
default: (trx-build-win "debug")
_docker_push tag:
docker push {{tag}}:{{DOCKER_IMAGE_VERSION}}
_docker_build dockerfile tag force="0":
#!/usr/bin/env sh
full_tag="{{tag}}:{{DOCKER_IMAGE_VERSION}}"
if [ "{{force}}" = "0" ]; then
docker images --format '{''{.Repository}}:{''{.Tag}}' | grep '^'"$full_tag"'$' >/dev/null
if [ $? -eq 0 ]; then
echo "Docker image $full_tag found"
exit 0
fi
echo "Docker image $full_tag not found, trying to download from DockerHub"
if docker pull $full_tag; then
echo "Docker image $full_tag downloaded from DockerHub"
exit 0
fi
echo "Docker image $full_tag not found, trying to build"
fi
echo "Building Docker image: {{dockerfile}} → $full_tag"
docker build \
. \
-f {{dockerfile}} \
-t $full_tag
_docker_run tag *args:
#!/usr/bin/env sh
full_tag="{{tag}}:{{DOCKER_IMAGE_VERSION}}"
echo "Running docker image: $full_tag {{args}}"
docker run \
--rm \
--user \
{{HOST_USER_UID}}:{{HOST_USER_GID}} \
-v {{CWD}}:/app/ \
$full_tag \
{{args}}
image-win force="1": (_docker_build "tools/shared/docker/game-win/Dockerfile" "rrdash/trx-win" force)
image-linux force="1": (_docker_build "tools/shared/docker/game-linux/Dockerfile" "rrdash/trx-linux" force)
image-win-installer force="1": (_docker_build "tools/shared/docker/installer/Dockerfile" "rrdash/trx-installer" force)
push-image-linux: (image-linux "0") (_docker_push "rrdash/trx-linux")
push-image-win: (image-win "0") (_docker_push "rrdash/trx-win")
import "justfile.tr1"
import "justfile.tr2"
import "justfile.tr3"
download-assets tr_version='all':
tools/download_assets {{tr_version}}
output-release-name:
tools/output_release_name
output-current-version *args:
tools/get_version {{args}}
output-current-changelog *args:
tools/output_current_changelog {{args}}
output-package-name *args:
tools/output_package_name {{args}}
clean:
-find build/ -type f -delete
-find tools/ -type f \( -ipath '*/out/*' -or -ipath '*/bin/*' -or -ipath '*/obj/*' \) -delete
-find . -mindepth 1 -empty -type d -delete
[group('lint')]
lint-imports:
tools/sort_imports
[group('lint')]
lint-format:
pre-commit run -a
[group('lint')]
lint: (lint-imports) (lint-format)
trx-build-linux target='debug': (image-linux "0") (_docker_run "rrdash/trx-linux" "build" "--target" target)
trx-build-win target='debug': (image-win "0") (_docker_run "rrdash/trx-win" "build" "--target" target)