Skip to content

Commit

Permalink
add helper script to build and push the different images
Browse files Browse the repository at this point in the history
  • Loading branch information
dave992 committed Nov 22, 2024
1 parent ad87e9f commit d782fe9
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .docker/build_and_push_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

REGISTRY=registry.tudelft.nl
REPOSITORY=scancontrol
USER=samxl

ROS_VERSION=humble

set -e

function build_image () {
if ! [[ $1 =~ ^(core|base|dev)$ ]]; then echo "wrong input, expected 'core', 'base', or 'dev'"; exit 0 ; fi
docker build . --target ${REPOSITORY}-$1 -t ${REGISTRY}/${USER}/${REPOSITORY}:${ROS_VERSION}-$1
}

function push_image () {
if ! [[ $1 =~ ^(core|base|dev)$ ]]; then echo "wrong input, expected 'core', 'base', or 'dev'"; exit 0 ; fi
docker push ${REGISTRY}/${USER}/${REPOSITORY}:${ROS_VERSION}-$1
}

build_image "core"
build_image "base"
build_image "dev"

push_image "core"
push_image "base"
push_image "dev"

0 comments on commit d782fe9

Please sign in to comment.