2024-03-08 05:05:23 +00:00
|
|
|
# https://taskfile.dev
|
|
|
|
|
|
|
|
version: '3'
|
|
|
|
|
|
|
|
dotenv:
|
|
|
|
- '.env'
|
|
|
|
|
|
|
|
vars:
|
|
|
|
VERSION:
|
2024-03-13 01:29:40 +00:00
|
|
|
sh: cat node/config/version.go | grep -A 1 "func GetVersion() \[\]byte {" | grep -Eo '0x[0-9a-fA-F]+' | xargs printf "%d.%d.%d"
|
2024-03-08 05:05:23 +00:00
|
|
|
GIT_REPO:
|
2024-03-24 08:11:58 +00:00
|
|
|
sh: git config --get remote.origin.url | sed 's/\.git$//'
|
2024-03-08 05:05:23 +00:00
|
|
|
GIT_BRANCH:
|
|
|
|
sh: git rev-parse --abbrev-ref HEAD
|
|
|
|
GIT_COMMIT:
|
|
|
|
sh: git log -1 --format=%h
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
status:
|
|
|
|
desc: Display configuration info.
|
|
|
|
cmds:
|
|
|
|
- echo -n "Image name:" && echo " ${QUILIBRIUM_IMAGE_NAME:-quilibrium}"
|
|
|
|
- echo -n "Version :" && echo " {{.VERSION}}"
|
|
|
|
- echo -n "Repo :" && echo " {{.GIT_REPO}}"
|
|
|
|
- echo -n "Branch :" && echo " {{.GIT_BRANCH}}"
|
|
|
|
- echo -n "Commit :" && echo " {{.GIT_COMMIT}}"
|
|
|
|
silent: true
|
2024-06-07 02:42:30 +00:00
|
|
|
|
|
|
|
build_node_arm64_macos:
|
|
|
|
desc: Build the Quilibrium node binary for MacOS ARM. Assumes it's ran from the same platform. Outputs to node/build.
|
|
|
|
cmds:
|
|
|
|
- vdf/generate.sh
|
|
|
|
- node/build.sh -o build/arm64_macos/node
|
|
|
|
|
|
|
|
build_node_arm64_linux:
|
|
|
|
desc: Build the Quilibrium node binary for ARM64 Linux. Outputs to node/build.
|
|
|
|
cmds:
|
|
|
|
- docker build --platform linux/arm64 -f Dockerfile --output node/build/arm64_linux --target=node .
|
|
|
|
|
|
|
|
build_node_amd64_linux:
|
|
|
|
desc: Build the Quilibrium node binary for AMD64 Linux. Outputs to node/build.
|
|
|
|
cmds:
|
|
|
|
- docker build --platform linux/amd64 -f Dockerfile --output node/build/amd64_linux --target=node .
|
2024-03-08 05:05:23 +00:00
|
|
|
|
|
|
|
build:
|
|
|
|
desc: Build the Quilibrium docker image, unless it is already built.
|
|
|
|
cmds:
|
|
|
|
- |
|
|
|
|
docker build \
|
2024-03-24 08:11:58 +00:00
|
|
|
--build-arg NODE_VERSION={{.VERSION}} \
|
2024-03-08 05:05:23 +00:00
|
|
|
--build-arg GIT_REPO={{.GIT_REPO}} \
|
|
|
|
--build-arg GIT_BRANCH={{.GIT_BRANCH}} \
|
|
|
|
--build-arg GIT_COMMIT={{.GIT_COMMIT}} \
|
|
|
|
-t ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:{{.VERSION}} \
|
|
|
|
-t ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:latest \
|
|
|
|
.
|
|
|
|
status:
|
|
|
|
- |
|
|
|
|
docker image inspect \
|
|
|
|
${QUILIBRIUM_IMAGE_NAME:-quilibrium}:{{.VERSION}} \
|
|
|
|
>/dev/null 2>/dev/null
|
|
|
|
|
|
|
|
github:login:
|
|
|
|
desc: Login to GitHub container registry.
|
|
|
|
cmds:
|
|
|
|
- echo $GITHUB_TOKEN | docker login ghcr.io -u $GITHUB_USERNAME --password-stdin
|
|
|
|
|
2024-03-24 08:11:58 +00:00
|
|
|
docker:login:
|
|
|
|
desc: Login to Docker hub
|
|
|
|
cmds:
|
|
|
|
- echo $DOCKER_TOKEN | docker login -u $DOCKER_USERNAME --password-stdin
|
|
|
|
|
2024-03-08 05:05:23 +00:00
|
|
|
push:
|
|
|
|
desc: Push Quilibrium docker image to the container registry.
|
|
|
|
cmds:
|
|
|
|
- docker push ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:{{.VERSION}}
|
|
|
|
- docker push ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:latest
|