- split into multiple jobs - specify tags for runner large - use buildx and add separate builder default has no cache - build image from cache and push to registry - compose use tag and pull - use cache tag for reuse - https://github.com/moby/buildkit/issues/1981 - https://github.com/moby/buildkit/issues/3730 - use cache-to and cache-from with registry/cache - add dockerignore to prevent rebuild on git changes - use individual builders - add step for docker compose up - update readme - update dockerignore - add gitignore - use script reduce duplicate code - cache from and to in build, compose use cache - dont push images just use cache - build in compose step from cache Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
stages:
|
|
- build
|
|
- test
|
|
|
|
default:
|
|
image: docker:24.0.7
|
|
services:
|
|
- docker:24.0.7-dind
|
|
before_script:
|
|
- docker version
|
|
- docker compose version
|
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
|
|
|
variables:
|
|
VLS_CONTAINER_REGISTRY: $CI_REGISTRY/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME
|
|
CACHE: $CI_REGISTRY_IMAGE/cache
|
|
CACHE_TAG: $CI_COMMIT_REF_SLUG
|
|
IMAGE_TAG: $CI_COMMIT_SHA
|
|
|
|
build_bitcoin:
|
|
tags: [ saas-linux-large-amd64 ]
|
|
stage: build
|
|
script:
|
|
- ./scripts/build_image_cache.sh bitcoind
|
|
build_core_lightning:
|
|
tags: [ saas-linux-large-amd64 ]
|
|
stage: build
|
|
script:
|
|
- ./scripts/build_image_cache.sh lightningd
|
|
build_txoo:
|
|
tags: [ saas-linux-medium-amd64 ]
|
|
stage: build
|
|
script:
|
|
- ./scripts/build_image_cache.sh txood
|
|
build_vls:
|
|
tags: [ saas-linux-large-amd64 ]
|
|
stage: build
|
|
script:
|
|
- ./scripts/build_image_cache.sh vlsd
|
|
compose:
|
|
tags: [ saas-linux-medium-amd64 ]
|
|
stage: test
|
|
variables:
|
|
BUILDER: compose_builder
|
|
before_script:
|
|
- docker volume create bitcoin_data
|
|
- docker volume create lightning_data
|
|
- docker volume create txoo_data
|
|
- docker volume create vls_data
|
|
- docker buildx create --name=$BUILDER --use
|
|
script:
|
|
- echo "IMAGE_TAG=${IMAGE_TAG}" > .env
|
|
- ./scripts/build_from_cache.sh bitcoind
|
|
- ./scripts/build_from_cache.sh lightningd
|
|
- ./scripts/build_from_cache.sh txood
|
|
- ./scripts/build_from_cache.sh vlsd
|
|
- docker compose --profile vls up -d --wait --wait-timeout 120 --build
|