-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (26 loc) · 1018 Bytes
/
Makefile
File metadata and controls
35 lines (26 loc) · 1018 Bytes
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
.PHONY: build run clean shell setup
HOST_UID := $(shell id -u)
HOST_GID := $(shell id -g)
export PARANOID_MODE ?= true
RANDOM_ID := $(shell openssl rand -hex 6 2>/dev/null || echo "default")
export SECRET_TARGET_PATH = /run/secrets/gh_$(RANDOM_ID)
setup:
mkdir -p .pi-data .secrets workspace src
chmod 700 .pi-data .secrets workspace
@chmod 600 .secrets/github_token.txt 2>/dev/null || true
touch .secrets/github_token.txt
chmod 600 .secrets/github_token.txt
@if [ -f .env ]; then grep "^GITHUB_TOKEN=" .env | cut -d '=' -f2- > .secrets/github_token.txt; fi
chmod 000 .secrets/github_token.txt
build: setup
docker compose build
update: setup
docker compose build --no-cache
run: setup
HOST_UID=$(HOST_UID) HOST_GID=$(HOST_GID) docker compose run --rm pi-agent
run-args: setup
HOST_UID=$(HOST_UID) HOST_GID=$(HOST_GID) docker compose run --rm pi-agent $(args)
shell: setup
HOST_UID=$(HOST_UID) HOST_GID=$(HOST_GID) docker compose run --entrypoint /bin/bash --rm pi-agent
clean:
docker compose down