Skip to content
Snippets Groups Projects
Verified Commit 9a6bd66a authored by Peter Stanko's avatar Peter Stanko
Browse files

Universal build docker compose

parent d9e5bd92
No related branches found
No related tags found
No related merge requests found
#! /bin/bash
WORK_DIR="$(mktemp -d)"
ORGNAME="kontr2"
BASE_REPO="git@gitlab.fi.muni.cz:grp-kontr2"
function build_one()
{
name=$1
repo=$2
path="$WORK_DIR/$name"
echo "[BUILD] \"$name\": ${repo}"
echo "[CLONE] \"$repo\" to \"$path\" "
git clone --depth 1 "$repo" "$path"
tag="$ORGNAME/$name"
echo "[DOCKER] Building $tag"
docker build --tag "$tag" "$path"
echo "[DOCKER] Pushing $tag"
docker push "$tag"
}
function build_portal_all()
{
echo "[BUILD] All portal related images"
build_one "portal" "$BASE_REPO/portal.git"
build_one "frontend" "$BASE_REPO/portal-frontend.git"
}
function build_all()
{
echo "[BUILD] All docker images"
build_portal_all
}
build_all
version: '3'
services:
base:
build: base
image: kontr2/base-pipenv
ktdk:
build: ktdk
image: kontr2/ktdk-runner
ktdk-cpp:
build:
context: ktdk
dockerfile: cpp-runner.Dockerfile
image: kontr2/ktdk-cpp-runner
portal:
build: https://gitlab.fi.muni.cz/grp-kontr2/portal.git
image: kontr2/portal
frontend:
build: https://gitlab.fi.muni.cz/grp-kontr2/portal-frontend.git
image: kontr2/portal-frontend
kontr-worker:
build: https://gitlab.fi.muni.cz/grp-kontr2/kontr-worker.git
image: kontr2/kontr-worker
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment