-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
executable file
·32 lines (30 loc) · 908 Bytes
/
build.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
#!/bin/bash
set -eux -o pipefail
if [ "$PROJECT" = "docker" ]; then
pip install PyYAML
python generate-compose.py 1 > docker-compose.yml
docker-compose build
docker-compose up &
pip install requests
python3 wait-for-http.py http://localhost:8000/log
python3 wait-for-http.py http://localhost:8001/kv/_config
docker-compose stop
if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
docker push potboiler/core
docker push potboiler/kv
docker push potboiler/pigtail
fi
exit 0
elif [ "$PROJECT" = "check" ]; then
rustup component add rustfmt-preview
rustup component add clippy-preview
cargo fmt -- --check
cargo clippy
exit 0
fi
export PATH=$PATH:~/.cargo/bin &&
export DATABASE_URL=${DATABASE_URL:-postgresql://postgres:@localhost:5432} # Default works on Travis
cd "$PROJECT"
cargo build
cargo test