-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathentrypoint.sh
executable file
·48 lines (41 loc) · 1.03 KB
/
entrypoint.sh
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
43
44
45
46
47
48
#!/bin/sh
check_bundle() {
bundle config set path /gems && bundle check || bundle install -j "$(nproc)"
}
cd /app || exit
export BOOTSTRAP_VERSION="${BOOTSTRAP_VERSION:-~>5.3}"
PIDFILE=.internal_test_app/tmp/pids/server.pid
if [ -e "${PIDFILE}" ]; then
rm "$PIDFILE"
fi
case $1 in
clean)
rm -rf .internal_test_app
echo "Test application removed. You can start this container again to get a freshly generated application"
;;
start)
check_bundle
if [ ! -s .internal_test_app/Gemfile.lock ]; then
bundle exec rake engine_cart:generate
fi
exec bundle exec rake engine_cart:server['-b 0.0.0.0']
;;
test)
check_bundle
bundle exec rake engine_cart:generate
exec bundle exec rake spec
;;
rubocop)
check_bundle
bundle exec rubocop
;;
update)
# generates a new Gemfile.lock
exec bundle update
;;
shell)
exec /bin/bash;;
*)
exec "$@"
;;
esac