110 lines
3.5 KiB
YAML
110 lines
3.5 KiB
YAML
|
|
# 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
|
||
|
|
- docker/Dockerfile.*-ci
|
||
|
|
- docker/ci-entrypoints/**
|
||
|
|
- kraiken-lib/**
|
||
|
|
- onchain/**
|
||
|
|
- services/ponder/**
|
||
|
|
- services/txnBot/**
|
||
|
|
- web-app/**
|
||
|
|
- landing/**
|
||
|
|
|
||
|
|
steps:
|
||
|
|
# Compile Solidity contracts to generate ABI files needed by Dockerfiles
|
||
|
|
- name: compile-contracts
|
||
|
|
image: registry.niovi.voyage/harb/node-ci:latest
|
||
|
|
commands:
|
||
|
|
- |
|
||
|
|
bash -lc '
|
||
|
|
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
|
||
|
|
|
||
|
|
# Build and push node-ci (base image with Foundry pre-installed)
|
||
|
|
echo "=== Building node-ci ==="
|
||
|
|
docker build \
|
||
|
|
-f docker/Dockerfile.node-ci \
|
||
|
|
-t "$REGISTRY/harb/node-ci:${CI_COMMIT_SHA:0:7}" \
|
||
|
|
-t "$REGISTRY/harb/node-ci:latest" \
|
||
|
|
.
|
||
|
|
docker push "$REGISTRY/harb/node-ci:${CI_COMMIT_SHA:0:7}"
|
||
|
|
docker push "$REGISTRY/harb/node-ci:latest"
|
||
|
|
|
||
|
|
# Build and push ponder-ci
|
||
|
|
echo "=== Building ponder-ci ==="
|
||
|
|
docker build \
|
||
|
|
-f docker/Dockerfile.ponder-ci \
|
||
|
|
-t "$REGISTRY/harb/ponder-ci:${CI_COMMIT_SHA:0:7}" \
|
||
|
|
-t "$REGISTRY/harb/ponder-ci:latest" \
|
||
|
|
.
|
||
|
|
docker push "$REGISTRY/harb/ponder-ci:${CI_COMMIT_SHA:0:7}"
|
||
|
|
docker push "$REGISTRY/harb/ponder-ci:latest"
|
||
|
|
|
||
|
|
# Build and push webapp-ci
|
||
|
|
echo "=== Building webapp-ci ==="
|
||
|
|
docker build \
|
||
|
|
-f docker/Dockerfile.webapp-ci \
|
||
|
|
-t "$REGISTRY/harb/webapp-ci:${CI_COMMIT_SHA:0:7}" \
|
||
|
|
-t "$REGISTRY/harb/webapp-ci:latest" \
|
||
|
|
.
|
||
|
|
docker push "$REGISTRY/harb/webapp-ci:${CI_COMMIT_SHA:0:7}"
|
||
|
|
docker push "$REGISTRY/harb/webapp-ci:latest"
|
||
|
|
|
||
|
|
# Build and push landing-ci
|
||
|
|
echo "=== Building landing-ci ==="
|
||
|
|
docker build \
|
||
|
|
-f docker/Dockerfile.landing-ci \
|
||
|
|
-t "$REGISTRY/harb/landing-ci:${CI_COMMIT_SHA:0:7}" \
|
||
|
|
-t "$REGISTRY/harb/landing-ci:latest" \
|
||
|
|
.
|
||
|
|
docker push "$REGISTRY/harb/landing-ci:${CI_COMMIT_SHA:0:7}"
|
||
|
|
docker push "$REGISTRY/harb/landing-ci:latest"
|
||
|
|
|
||
|
|
# Build and push txnbot-ci
|
||
|
|
echo "=== Building txnbot-ci ==="
|
||
|
|
docker build \
|
||
|
|
-f docker/Dockerfile.txnbot-ci \
|
||
|
|
-t "$REGISTRY/harb/txnbot-ci:${CI_COMMIT_SHA:0:7}" \
|
||
|
|
-t "$REGISTRY/harb/txnbot-ci:latest" \
|
||
|
|
.
|
||
|
|
docker push "$REGISTRY/harb/txnbot-ci:${CI_COMMIT_SHA:0:7}"
|
||
|
|
docker push "$REGISTRY/harb/txnbot-ci:latest"
|
||
|
|
|
||
|
|
echo "=== All CI images built and pushed ==="
|