Skip to content

Commit 1575bce

Browse files
authored
Merge pull request #147 from stader-labs/local_dev
Add build scrip for local dev
2 parents 0dd74b2 + 73113a2 commit 1575bce

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

Diff for: daemon-local.sh

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
# Print usage
4+
usage() {
5+
echo "Usage: daemon-local.sh -v <version number>"
6+
exit 0
7+
}
8+
9+
DOCKER_ACCOUNT=staderlabs
10+
# Parse arguments
11+
while getopts "acpdnlrfv:" FLAG; do
12+
case "$FLAG" in
13+
v) VERSION="$OPTARG" ;;
14+
*) usage ;;
15+
esac
16+
done
17+
if [ -z "$VERSION" ]; then
18+
usage
19+
fi
20+
21+
# Get CPU architecture
22+
UNAME_VAL=$(uname -m)
23+
ARCH=""
24+
case $UNAME_VAL in
25+
x86_64) ARCH="amd64" ;;
26+
aarch64) ARCH="arm64" ;;
27+
arm64) ARCH="arm64" ;;
28+
*) fail "CPU architecture not supported: $UNAME_VAL" ;;
29+
esac
30+
31+
32+
echo "Start buiding: " $VERSION
33+
34+
docker run --rm -v $PWD:/stader-node staderdev/stader-node-builder:latest /stader-node/stader/build.sh
35+
36+
cp stader/stader-daemon-* build/$VERSION
37+
38+
echo "done!"
39+
40+
docker buildx build --platform=linux/$ARCH -t $DOCKER_ACCOUNT/stader-permissionless:$VERSION -f docker/stader-dockerfile --load . || fail "Error building $ARCH Docker Stader Daemon image."
41+
42+
echo "done!"

0 commit comments

Comments
 (0)