~cyplo/dotfiles

ref: 57ef81646178fb56b9e7df2ae6b00f5dfe3bba0d dotfiles/test -rwxr-xr-x 677 bytes
57ef8164 — Cyryl Płotnicki Merge branch 'master' into cucumber 5 years ago
                                                                                
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

if [[ -z $DETECTED_OS ]]; then
    echo "cannot detect OS, please set DETECTED_OS manually"
    exit 1
fi

if [[ $DETECTED_OS =~ .*:.* ]]; then
   SYSTEM_NAME=`echo $DETECTED_OS | cut -d':' -f1` 
   SYSTEM_VERSION=`echo $DETECTED_OS | cut -d':' -f2` 
else
    echo "please set DETECTED_OS to system:version"
    exit 1
fi

INSIDER_ROOT_DIR=/root/temp/dotfiles/
CURRENT_DIR=`pwd`

SYSTEM_DIR="$SYSTEM_NAME/"
SYSTEM_VERSION_DIR="$SYSTEM_NAME/$SYSTEM_VERSION/"

if [[ -d "$CURRENT_DIR/$SYSTEM_VERSION_DIR" ]]; then
    DIR=$SYSTEM_VERSION_DIR
else
    DIR=$SYSTEM_DIR
fi

docker run -v $CURRENT_DIR:$INSIDER_ROOT_DIR $DETECTED_OS $INSIDER_ROOT_DIR/$DIR/test_insider