Create a gist now

Instantly share code, notes, and snippets.

@tcrayford /cibuild.sh Secret
Last active Aug 29, 2015

What would you like to do?
#!/bin/bash
set -e
set -o pipefail
with_timestamps() {
while read -r line; do
echo -e "$(date +%T)\t$line"
done
}
run_tests() {
. .test.env
cd app
echo "starting"
(lein with-profile production uberjar) &
prod_uberjar_pid=$!
(lein with-profile ci-tests uberjar) &
test_uberjar_pid=$!
wait "$test_uberjar_pid" || { exit 1; }
echo "test uberjar finished"
wait "$prod_uberjar_pid" || { exit 1; }
echo "prod uberjar finished"
java -cp "target/production/yeller-0.1.0-SNAPSHOT-standalone.jar:target/ci-tests/yeller-0.1.0-SNAPSHOT-standalone.jar" clojure.main -e "(require 'yeller.dev) (yeller.dev/run-tests-and-exit)"
java -jar target/production/yeller-0.1.0-SNAPSHOT-standalone.jar check
cp target/production/yeller-0.1.0-SNAPSHOT-standalone.jar "$CIRCLE_ARTIFACTS/yeller.jar"
}
run_tests | with_timestamps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment