Skip to content

Commit fa27628

Browse files
committed
put the shell code in a script
1 parent eb7ede3 commit fa27628

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

.evergreen/functions.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,11 +659,13 @@ functions:
659659
- command: shell.exec
660660
type: setup
661661
params:
662-
working_dir: src
662+
working_dir: compass-mongodb-com
663663
shell: bash
664664
script: |
665665
set -e
666666
667+
source ../src/.evergreen/start-compass-mongodb-com.sh
668+
667669
docker build -t compass/web ./
668670
docker run -p 8080:8080 -t -e PORT=8080 -e UPDATE_CHECKER_ALLOW_DOWNGRADES=true -d compass/web
669671
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
set -e
2+
3+
HAS_DOCKER=false
4+
5+
DOCKER_BUILD=""
6+
7+
echo "Checking if docker is available ..."
8+
9+
if docker version &>/dev/null; then
10+
echo " docker is available, checking docker build"
11+
if docker compose version &>/dev/null; then
12+
echo " docker build is available"
13+
HAS_DOCKER=true
14+
DOCKER_BUILD="docker build"
15+
else
16+
echo " docker compose could not be found, trying standalone docker-compose as a fallback"
17+
if docker-build version &>/dev/null; then
18+
HAS_DOCKER=true
19+
DOCKER_BUILD="docker-build"
20+
else
21+
echo " docker build not found"
22+
fi
23+
fi
24+
fi
25+
26+
if [ "$HAS_DOCKER" = true ]; then
27+
$DOCKER_BUILD -t compass/web ./
28+
docker run -p 8080:8080 -t -e PORT=8080 -e UPDATE_CHECKER_ALLOW_DOWNGRADES=true -d compass/web
29+
else
30+
echo " docker not found"
31+
fi

0 commit comments

Comments
 (0)