feat (devops): add local image build for releases

* this script is specifically for releases only (alt to ci)
* make sure to bump the tag after it is run
This commit is contained in:
Mohamed Sohail 2021-12-30 11:22:09 +03:00
parent 4b87a40cc2
commit ec80d35194
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D
2 changed files with 75 additions and 0 deletions

52
docker-compose.build.yml Normal file
View File

@ -0,0 +1,52 @@
version: '3.2'
services:
cic-cache:
image: ${IMAGE_BASE_URL:-registry.gitlab.com/grassrootseconomics/cic-internal-integration}/cic-cache:${TAG:-latest}
build:
context: apps/cic-cache
dockerfile: docker/Dockerfile
cache_from:
- ${IMAGE_BASE_URL:-registry.gitlab.com/grassrootseconomics/cic-internal-integration}/cic-cache:latest
cic-eth:
image: ${IMAGE_BASE_URL:-registry.gitlab.com/grassrootseconomics/cic-internal-integration}/cic-eth:${TAG:-latest}
build:
context: apps/cic-eth
dockerfile: docker/Dockerfile
cache_from:
- ${IMAGE_BASE_URL:-registry.gitlab.com/grassrootseconomics/cic-internal-integration}/cic-eth:latest
cic-meta:
image: ${IMAGE_BASE_URL:-registry.gitlab.com/grassrootseconomics/cic-internal-integration}/cic-meta:${TAG:-latest}
build:
context: apps/cic-meta
dockerfile: docker/Dockerfile
cache_from:
- ${IMAGE_BASE_URL:-registry.gitlab.com/grassrootseconomics/cic-internal-integration}/cic-meta:latest
cic-notify:
image: ${IMAGE_BASE_URL:-registry.gitlab.com/grassrootseconomics/cic-internal-integration}/cic-notify:${TAG:-latest}
build:
context: apps/cic-notify
dockerfile: docker/Dockerfile
cache_from:
- ${IMAGE_BASE_URL:-registry.gitlab.com/grassrootseconomics/cic-internal-integration}/cic-notify:latest
funga-eth:
image: ${IMAGE_BASE_URL:-registry.gitlab.com/grassrootseconomics/cic-internal-integration}/funga-eth:${TAG:-latest}
build:
context: apps/cic-signer
dockerfile: Dockerfile
cache_from:
- ${IMAGE_BASE_URL:-registry.gitlab.com/grassrootseconomics/cic-internal-integration}/funga-eth:latest
cic-ussd:
image: ${IMAGE_BASE_URL:-registry.gitlab.com/grassrootseconomics/cic-internal-integration}/cic-ussd:${TAG:-latest}
build:
context: apps/cic-ussd
dockerfile: docker/Dockerfile
cache_from:
- ${IMAGE_BASE_URL:-registry.gitlab.com/grassrootseconomics/cic-internal-integration}/cic-ussd:latest
cic-contract-bootstrap:
image: ${IMAGE_BASE_URL:-registry.gitlab.com/grassrootseconomics/cic-internal-integration}/cic-contract-bootstrap:${TAG:-latest}
build:
context: apps/contract-migration
dockerfile: docker/Dockerfile
cache_from:
- ${IMAGE_BASE_URL:-registry.gitlab.com/grassrootseconomics/cic-internal-integration}/cic-ussd:latest

View File

@ -0,0 +1,23 @@
#!/usr/bin/env sh
# dependencies:
# - docker-compose >= v1.25.0
# - sbot >= v1.0.0.
set -e
export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1
PREDICTED_TAG=$(sbot predict version -m auto)
docker-compose -f docker-compose.build.yml build --progress plain
export TAG=v$PREDICTED_TAG
docker-compose -f docker-compose.build.yml build --progress plain
docker-compose -f docker-compose.build.yml push
export TAG=latest
docker-compose -f docker-compose.build.yml push