This repository was archived by the owner on Mar 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·42 lines (35 loc) · 1.39 KB
/
install.sh
File metadata and controls
executable file
·42 lines (35 loc) · 1.39 KB
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
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
CI_DIR="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"
SPLITGRAPH_DIR="$CI_DIR/.."
if test -n "$ACT" ; then
. "$CI_DIR"/debug/libdebug.sh
fi
# yarn cache is per branch by default. Clear it with commit pragma [clear cache]
if test ! -z "$YARN_CACHE_FOLDER" ; then
if git log --format=%B HEAD -n1 | grep -q '[clear cache]' ; then
>&2 echo "Clear cache ${YARN_CACHE_FOLDER}..."
test -d "$YARN_CACHE_FOLDER" && rm -r "$YARN_CACHE_FOLDER"
fi
mkdir -p "$YARN_CACHE_FOLDER"
echo "Yarn cache ($YARN_CACHE_FOLDER): $(ls -l "$YARN_CACHE_FOLDER" | wc -l)"
fi
# For debugging: Sleep in foreground so user can attach to container
# (I couldn't find how to force act to run the container in interactive mode)
if test -n "$BREAK_INTERACTIVE_BEFORE_INSTALL" ; then
echo "BREAK_INTERACTIVE_ON_INSTALL is set (not empty)"
infinite_sleep
fi
# We need to set the special lockfile name here, because if we use yarn.lock,
# then when running in the parent monorepo, yarn will think its in its own root
export WORKSPACE_LOCKFILE=yarn-public-workspace.lock
export DEBUG=1
pushd "$SPLITGRAPH_DIR" \
&& ./setup.sh \
&& yarn install --immutable \
&& echo "Installed successfully" \
&& (
test ! -z "$YARN_CACHE_FOLDER" \
&& echo "Yarn cache ($YARN_CACHE_FOLDER): $(ls -l "$YARN_CACHE_FOLDER" | wc -l)" \
|| true
) && exit 0
exit 1