2026-02-02 19:24:57 +01:00
|
|
|
# Build and push CI images for E2E testing services
|
|
|
|
|
# Triggered on changes to service code or Dockerfiles
|
|
|
|
|
|
|
|
|
|
kind: pipeline
|
|
|
|
|
type: docker
|
|
|
|
|
name: build-ci-images
|
|
|
|
|
|
|
|
|
|
when:
|
|
|
|
|
event: push
|
|
|
|
|
branch:
|
|
|
|
|
- master
|
|
|
|
|
- feature/ci
|
|
|
|
|
path:
|
|
|
|
|
include:
|
|
|
|
|
- .woodpecker/build-ci-images.yml
|
2026-02-03 12:07:28 +01:00
|
|
|
- docker/Dockerfile.service-ci
|
|
|
|
|
- docker/Dockerfile.node-ci
|
|
|
|
|
- containers/*-entrypoint.sh
|
|
|
|
|
- containers/entrypoint-common.sh
|
2026-02-02 19:24:57 +01:00
|
|
|
- kraiken-lib/**
|
|
|
|
|
- onchain/**
|
|
|
|
|
- services/ponder/**
|
|
|
|
|
- services/txnBot/**
|
|
|
|
|
- web-app/**
|
|
|
|
|
- landing/**
|
2026-02-03 12:07:28 +01:00
|
|
|
- scripts/sync-tax-rates.mjs
|
|
|
|
|
- scripts/bootstrap-common.sh
|
2026-02-02 19:24:57 +01:00
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
# Compile Solidity contracts to generate ABI files needed by Dockerfiles
|
|
|
|
|
- name: compile-contracts
|
|
|
|
|
image: registry.niovi.voyage/harb/node-ci:latest
|
|
|
|
|
commands:
|
|
|
|
|
- |
|
2026-02-03 12:07:28 +01:00
|
|
|
bash -c '
|
2026-02-02 19:24:57 +01:00
|
|
|
set -euo pipefail
|
|
|
|
|
# Initialize git submodules (required for forge dependencies)
|
|
|
|
|
git submodule update --init --recursive
|
|
|
|
|
# Install uni-v3-lib dependencies (required for Uniswap interfaces)
|
|
|
|
|
yarn --cwd onchain/lib/uni-v3-lib install --frozen-lockfile
|
|
|
|
|
# Build contracts to generate ABI files
|
|
|
|
|
cd onchain
|
|
|
|
|
export PATH=/root/.foundry/bin:$PATH
|
|
|
|
|
forge build
|
|
|
|
|
'
|
|
|
|
|
|
|
|
|
|
- name: build-and-push-images
|
|
|
|
|
image: docker:27-cli
|
|
|
|
|
volumes:
|
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
|
|
|
environment:
|
|
|
|
|
REGISTRY: registry.niovi.voyage
|
|
|
|
|
REGISTRY_USER: ciuser
|
|
|
|
|
REGISTRY_PASSWORD:
|
|
|
|
|
from_secret: registry_password
|
|
|
|
|
commands:
|
|
|
|
|
- |
|
|
|
|
|
set -eux
|
|
|
|
|
|
|
|
|
|
# Login to registry
|
|
|
|
|
echo "$REGISTRY_PASSWORD" | docker login "$REGISTRY" -u "$REGISTRY_USER" --password-stdin
|
|
|
|
|
|
2026-02-03 12:07:28 +01:00
|
|
|
SHA="${CI_COMMIT_SHA:0:7}"
|
|
|
|
|
|
2026-02-02 19:24:57 +01:00
|
|
|
# Build and push node-ci (base image with Foundry pre-installed)
|
|
|
|
|
echo "=== Building node-ci ==="
|
|
|
|
|
docker build \
|
|
|
|
|
-f docker/Dockerfile.node-ci \
|
2026-02-03 12:07:28 +01:00
|
|
|
-t "$REGISTRY/harb/node-ci:$SHA" \
|
2026-02-02 19:24:57 +01:00
|
|
|
-t "$REGISTRY/harb/node-ci:latest" \
|
|
|
|
|
.
|
2026-02-03 12:07:28 +01:00
|
|
|
docker push "$REGISTRY/harb/node-ci:$SHA"
|
2026-02-02 19:24:57 +01:00
|
|
|
docker push "$REGISTRY/harb/node-ci:latest"
|
|
|
|
|
|
2026-02-03 12:07:28 +01:00
|
|
|
# Build and push ponder-ci (unified Dockerfile)
|
2026-02-02 19:24:57 +01:00
|
|
|
echo "=== Building ponder-ci ==="
|
|
|
|
|
docker build \
|
2026-02-03 12:07:28 +01:00
|
|
|
-f docker/Dockerfile.service-ci \
|
|
|
|
|
--build-arg SERVICE_DIR=services/ponder \
|
|
|
|
|
--build-arg SERVICE_PORT=42069 \
|
|
|
|
|
--build-arg ENTRYPOINT_SCRIPT=containers/ponder-entrypoint.sh \
|
|
|
|
|
--build-arg HEALTHCHECK_RETRIES=12 \
|
|
|
|
|
--build-arg HEALTHCHECK_START=20s \
|
|
|
|
|
--build-arg NEEDS_SYMLINKS=false \
|
|
|
|
|
-t "$REGISTRY/harb/ponder-ci:$SHA" \
|
2026-02-02 19:24:57 +01:00
|
|
|
-t "$REGISTRY/harb/ponder-ci:latest" \
|
|
|
|
|
.
|
2026-02-03 12:07:28 +01:00
|
|
|
docker push "$REGISTRY/harb/ponder-ci:$SHA"
|
2026-02-02 19:24:57 +01:00
|
|
|
docker push "$REGISTRY/harb/ponder-ci:latest"
|
|
|
|
|
|
2026-02-03 12:07:28 +01:00
|
|
|
# Build and push webapp-ci (unified Dockerfile)
|
2026-02-02 19:24:57 +01:00
|
|
|
echo "=== Building webapp-ci ==="
|
|
|
|
|
docker build \
|
2026-02-03 12:07:28 +01:00
|
|
|
-f docker/Dockerfile.service-ci \
|
|
|
|
|
--build-arg SERVICE_DIR=web-app \
|
|
|
|
|
--build-arg SERVICE_PORT=5173 \
|
|
|
|
|
--build-arg HEALTHCHECK_PATH=/app/ \
|
|
|
|
|
--build-arg HEALTHCHECK_RETRIES=84 \
|
|
|
|
|
--build-arg HEALTHCHECK_START=15s \
|
|
|
|
|
--build-arg ENTRYPOINT_SCRIPT=containers/webapp-entrypoint.sh \
|
|
|
|
|
--build-arg NODE_ENV=development \
|
|
|
|
|
--build-arg NEEDS_SYMLINKS=true \
|
|
|
|
|
-t "$REGISTRY/harb/webapp-ci:$SHA" \
|
2026-02-02 19:24:57 +01:00
|
|
|
-t "$REGISTRY/harb/webapp-ci:latest" \
|
|
|
|
|
.
|
2026-02-03 12:07:28 +01:00
|
|
|
docker push "$REGISTRY/harb/webapp-ci:$SHA"
|
2026-02-02 19:24:57 +01:00
|
|
|
docker push "$REGISTRY/harb/webapp-ci:latest"
|
|
|
|
|
|
2026-02-03 12:07:28 +01:00
|
|
|
# Build and push landing-ci (unified Dockerfile)
|
2026-02-02 19:24:57 +01:00
|
|
|
echo "=== Building landing-ci ==="
|
|
|
|
|
docker build \
|
2026-02-03 12:07:28 +01:00
|
|
|
-f docker/Dockerfile.service-ci \
|
|
|
|
|
--build-arg SERVICE_DIR=landing \
|
|
|
|
|
--build-arg SERVICE_PORT=5174 \
|
|
|
|
|
--build-arg ENTRYPOINT_SCRIPT=containers/landing-ci-entrypoint.sh \
|
|
|
|
|
--build-arg NODE_ENV=development \
|
|
|
|
|
--build-arg HEALTHCHECK_RETRIES=6 \
|
|
|
|
|
--build-arg HEALTHCHECK_START=10s \
|
|
|
|
|
--build-arg NEEDS_SYMLINKS=false \
|
|
|
|
|
-t "$REGISTRY/harb/landing-ci:$SHA" \
|
2026-02-02 19:24:57 +01:00
|
|
|
-t "$REGISTRY/harb/landing-ci:latest" \
|
|
|
|
|
.
|
2026-02-03 12:07:28 +01:00
|
|
|
docker push "$REGISTRY/harb/landing-ci:$SHA"
|
2026-02-02 19:24:57 +01:00
|
|
|
docker push "$REGISTRY/harb/landing-ci:latest"
|
|
|
|
|
|
2026-02-03 12:07:28 +01:00
|
|
|
# Build and push txnbot-ci (unified Dockerfile)
|
2026-02-02 19:24:57 +01:00
|
|
|
echo "=== Building txnbot-ci ==="
|
|
|
|
|
docker build \
|
2026-02-03 12:07:28 +01:00
|
|
|
-f docker/Dockerfile.service-ci \
|
|
|
|
|
--build-arg SERVICE_DIR=services/txnBot \
|
|
|
|
|
--build-arg SERVICE_PORT=43069 \
|
|
|
|
|
--build-arg HEALTHCHECK_PATH=/status \
|
|
|
|
|
--build-arg HEALTHCHECK_RETRIES=4 \
|
|
|
|
|
--build-arg HEALTHCHECK_START=10s \
|
|
|
|
|
--build-arg ENTRYPOINT_SCRIPT=containers/txnbot-entrypoint.sh \
|
|
|
|
|
--build-arg NPM_INSTALL_CMD=install \
|
|
|
|
|
--build-arg NEEDS_SYMLINKS=false \
|
|
|
|
|
-t "$REGISTRY/harb/txnbot-ci:$SHA" \
|
2026-02-02 19:24:57 +01:00
|
|
|
-t "$REGISTRY/harb/txnbot-ci:latest" \
|
|
|
|
|
.
|
2026-02-03 12:07:28 +01:00
|
|
|
docker push "$REGISTRY/harb/txnbot-ci:$SHA"
|
2026-02-02 19:24:57 +01:00
|
|
|
docker push "$REGISTRY/harb/txnbot-ci:latest"
|
|
|
|
|
|
|
|
|
|
echo "=== All CI images built and pushed ==="
|