fxa/.circleci/build.sh

30 строки
850 B
Bash
Executable File

#!/bin/bash -e
MODULE=$1
DIR=$(dirname "$0")
if grep -e "$MODULE" -e 'all' "$DIR/../packages/test.list" > /dev/null; then
cd "$DIR/../packages/$MODULE"
echo -e "\n################################"
echo "# building $MODULE"
echo -e "################################\n"
mkdir -p ../../artifacts
if [[ -x scripts/build-ci.sh ]]; then
time ./scripts/build-ci.sh
elif [[ -r Dockerfile ]]; then
# send Dockerfile over stdin to exclude local context
# https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#pipe-dockerfile-through-stdin
time (< Dockerfile docker build --progress=plain -t "${MODULE}:build" - &> "../../artifacts/${MODULE}.log")
fi
# for debugging:
# docker run --rm -it ${MODULE}:build npm ls --production
# docker save -o "../${MODULE}.tar" ${MODULE}:build
else
exit 0;
fi