-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
29 lines (23 loc) · 830 Bytes
/
run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# SPDX-FileCopyrightText: Alliander N. V.
#
# SPDX-License-Identifier: Apache-2.0
SCRIPT_DIR=$(
cd "$(dirname "${BASH_SOURCE[0]}")" || exit
pwd -P
)
IMAGE=rcdt/robotics
SERVICE="${IMAGE/rcdt\//rcdt_}"
branch_name=$(git branch --show-current)
changed_files=($(git diff --name-only main))
image_tag="latest"
if [[ $branch_name != main ]] && [[ ${changed_files[@]} =~ dockerfiles/* || ${changed_files[@]} =~ .github/workflows/* ]]; then
image_tag="${branch_name/\//-}-latest"
fi
mkdir -p ~/.vscode-server
mkdir -p $SCRIPT_DIR/.config/pyflow
cp --update=none -a pyflow/default_config/. .config/pyflow
touch $SCRIPT_DIR/.personal.bashrc
docker pull $IMAGE:$image_tag
echo Running $IMAGE:$image_tag ...
IMAGE_TAG=$image_tag docker compose -f $SCRIPT_DIR/.devcontainer/docker-compose.yml run --rm $SERVICE