-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathjustfile
More file actions
65 lines (53 loc) · 2 KB
/
justfile
File metadata and controls
65 lines (53 loc) · 2 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
set dotenv-load
set export
TEST_IMAGE := env_var_or_default("TEST_IMAGE", "debian-systemd-docker-cli")
# Initialize a dotenv file for usage with a local debugger
# WARNING: It will override any previously generated dotenv file
init-dotenv:
@echo "Recreating .env file..."
@echo "TEST_IMAGE=$TEST_IMAGE" >> .env
@echo "C8Y_BASEURL=$C8Y_BASEURL" >> .env
@echo "C8Y_USER=$C8Y_USER" >> .env
@echo "C8Y_PASSWORD=$C8Y_PASSWORD" >> .env
@echo "PRIVATE_IMAGE=docker.io/example/app:latest" >> .env
@echo "REGISTRY1_REPO=docker.io" >> .env
@echo "REGISTRY1_USERNAME=" >> .env
@echo "REGISTRY1_PASSWORD=" >> .env
# Run linting
lint:
golangci-lint run
# Release all artifacts
release *ARGS='':
mkdir -p output
go run main.go completion bash > output/completions.bash
go run main.go completion zsh > output/completions.zsh
go run main.go completion fish > output/completions.fish
docker context use default
goreleaser release --clean --auto-snapshot {{ARGS}}
# install docker buildx and allow multi-arch builds
build-setup:
docker buildx install
docker run --privileged --rm tonistiigi/binfmt --install all
# Build a release locally (for testing the release artifacts)
build-local:
just -f "{{justfile()}}" release --snapshot
# Install python virtual environment
venv:
[ -d .venv ] || python3 -m venv .venv
./.venv/bin/pip3 install -r tests/requirements.txt
# Build test images and test artifacts
build-test:
docker buildx install
docker build --load -t {{TEST_IMAGE}} -f ./test-images/{{TEST_IMAGE}}/Dockerfile .
./tests/data/apps/build.sh
# Run tests
test *args='':
./.venv/bin/python3 -m robot.run --outputdir output {{args}} tests
# Download/update vendor packages
update-vendor:
go mod vendor
# Print yocto licensing string
print-yocto-licenses:
@echo 'LIC_FILES_CHKSUM = " \'
@find . -name "LICENSE*" -exec bash -c 'echo -n " file://src/\${GO_IMPORT}/{};md5=" && md5 -q {}' \; 2>/dev/null | grep -v "/\.venv/" | sed 's|$| \\|g' | sed 's|/\./|/|g'
@echo '"'