-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathjustfile
More file actions
99 lines (77 loc) · 3.3 KB
/
justfile
File metadata and controls
99 lines (77 loc) · 3.3 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
90
91
92
93
94
95
96
97
98
99
compose-signet *args="":
#! /usr/bin/env bash
if [ docker context inspect l2l-signet > /dev/null 2>&1 ]; then
echo "❌ No Docker context named 'l2l-signet' found"
exit 1
fi
docker --context l2l-signet compose \
--env-file .env.signet \
--profile signet \
-f docker-compose.base.yml \
-f docker-compose.signet.yml {{ args }}
compose-forknet *args="":
#! /usr/bin/env bash
if [ docker context inspect l2l-forknet > /dev/null 2>&1 ]; then
echo "❌ No Docker context named 'l2l-forknet' found"
exit 1
fi
docker --context l2l-forknet compose \
--env-file .env.forknet \
--profile forknet \
-f docker-compose.base.yml \
-f docker-compose.forknet.yml {{ args }}
rpcauth-commit := "fa5f29774872d18febc0df38831a6e45f3de69cc"
# https://github.com/bitcoin/bitcoin/blob/master/share/rpcauth/rpcauth.py
[doc("Generate RPC credentials for bitcoin.conf using Bitcoin Core's rpcauth.py. Empty password argument will generate a random password.")]
gen-bitcoin-core-pass username password='':
#! /usr/bin/env bash
script_file=$(mktemp)
curl --fail --silent --output $script_file https://raw.githubusercontent.com/bitcoin/bitcoin/{{ rpcauth-commit }}/share/rpcauth/rpcauth.py
output=$(uv run python $script_file --json {{ username }} {{ password }})
echo "RPC username: $(echo "$output" | jq -r '.username')"
echo "RPC password: $(echo "$output" | jq -r '.password')"
echo ""
echo "Add this to bitcoin.conf:"
echo "rpcauth=$(echo "$output" | jq -r '.rpcauth')"
get-latest-image service:
#! /usr/bin/env bash
if ! which uv > /dev/null; then
echo "uv is not installed"
exit 1
fi
if ! which gh > /dev/null; then
echo "gh (GitHub CLI) is not installed"
exit 1
fi
all_services=$(uv tool run yq -r '.services | keys[]' docker-compose.yml )
if ! echo "$all_services" | grep -q "{{ service }}"; then
echo "service '{{ service }}' not found"
exit 1
fi
image=$(uv tool run yq -r '.services["{{ service }}"].image' docker-compose.yml)
# if it is not a ghcr.io image, exit
if ! [[ "$image" == ghcr.io/* ]]; then
echo "❌ Only GitHub Container Registry (ghcr.io) images are supported"
echo "This image is from a different registry and cannot be checked automatically"
exit 1
fi
# Extract repository name from image
repo=$(echo "$image" | cut -d':' -f1)
# Get the package name (last part after /)
package=$(echo "$repo" | sed 's/.*\///')
# Get the org/user (part between ghcr.io/ and last /)
org=$(echo "$repo" | sed 's/ghcr.io\///' | sed 's/\/[^\/]*$//')
# Fetch the sha tag of the "latest" tag
tag=$(gh api \
"orgs/$org/packages/container/$package/versions?state=active&per_page=10" | \
jq -r '.[] | select(.metadata.container.tags | contains(["latest"])) | .metadata.container.tags[] | select(startswith("sha-"))')
if [ -z "$tag" ]; then
echo "❌ No sha tag found for the 'latest' tag"
exit 1
fi
echo "$tag"
prettier-version := "3.8.1"
prettier-write:
npx --yes prettier@{{ prettier-version }} --write .
prettier-check:
npx --yes prettier@{{ prettier-version }} --check .