File: test_docker.sh

package info (click to toggle)
baler 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 207,900 kB
  • sloc: python: 2,468; sh: 98; makefile: 7
file content (27 lines) | stat: -rwxr-xr-x 729 bytes parent folder | download | duplicates (2)
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
#!/bin/bash

# This script serves as a wrapper around docker run to run the docker image
# It also tests the docker image

DOCKERFILE="${DOCKERFILE:-Dockerfile}"
ARCH="${ARCH:-$(uname -m)}"
WORKSPACE_NAME="${WORKSPACE_NAME:-CMS_example}"
PROJECT_NAME="${PROJECT_NAME:-example_CMS}"
DOCKER_IMAGE="baler-${ARCH}:latest"

function run_docker() {
  local mode="$1"
  docker run -v "$(pwd)/workspaces:/baler-root/workspaces" \
             ${DOCKER_IMAGE} --mode "${mode}" --project "${WORKSPACE_NAME}" "${PROJECT_NAME}"
}

echo "Training the project..."
run_docker "train"

echo "Compressing the project..."
run_docker "compress"

echo "Decompressing the project..."
run_docker "decompress"

echo "All tasks completed successfully."