summaryrefslogtreecommitdiffstats
path: root/src/pmdk/utils/docker/prepare-for-build.sh
blob: f18c18c6805da1adf4b79b9dfdc8a481bec726ff (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
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2020, Intel Corporation

#
# prepare-for-build.sh - is called inside a Docker container; prepares
#                        the environment inside a Docker container for
#                        running build of PMDK project.
#

set -e

# This should be run only on CIs
if [ "$CI_RUN" == "YES" ]; then
	# Make sure $WORKDIR has correct access rights
	# - set them to the current UID and GID
	echo $USERPASS | sudo -S chown -R $(id -u).$(id -g) $WORKDIR
fi

# Configure tests (e.g. ssh for remote tests) unless the current configuration
# should be preserved
KEEP_TEST_CONFIG=${KEEP_TEST_CONFIG:-0}
if [[ "$KEEP_TEST_CONFIG" == 0 ]]; then
	./configure-tests.sh
fi