Welcome to mirror list, hosted at ThFree Co, Russian Federation.

run-in-docker.sh « workflows « .github - github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e70c30bcca1a3c719e66bf9ec8c90752a245ce95 (plain)
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
30
31
32
#! /bin/bash

image="$1"
shift

commands="$@"

if [[ "$image" == "" ]] || [[ "${commands[@]}" == "" ]]; then
    echo "Usage: bash $0 <image> <commands>"
    exit 1
fi

set -exo pipefail

extra_args=()

if tty -s; then
    extra_args+=("-t")
fi

docker run \
    --rm \
    --user "$(id -u)" \
    -i "${extra_args[@]}" \
    -e TX_TOKEN \
    -e HOME \
    -v "$HOME:$HOME" \
    -v "$(readlink -f .)":/ws \
    --entrypoint sh \
    -w /ws \
    "$image" \
    -c "${commands[@]}"