-
Notifications
You must be signed in to change notification settings - Fork 4
/
rfx_setup.sh
executable file
·61 lines (50 loc) · 1.28 KB
/
rfx_setup.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
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
# rfx_setup.sh
# - A utility to quickly clone a specific commit of the RFX repo.
# - Hopefully makes it easier to reproduce bugs and failing tests.
#
# Workflow:
# > wget https://raw.githubusercontent.com/andyl/rfx/master/test/rfx_setup.sh
# > chmod a+rx ./rfx_setup.sh
# > ./rfx_setup.sh <your_sha>
# > cd rfx
# > mix test <your_test_path>
#
# Notes:
# - this is only tested on Ubuntu 20.04
# - it might work on Mac
# - it will fail on Windows
# - please file issues and/or submit PRs if you find bugs in this script!
#
abort_argv() {
echo "Usage: rfx_setup.sh <SHA>"
echo "rfx_setup.sh - clone and setup the RFX repo"
echo "visit https://github.com/andyl/rfx for more info"
exit 1
}
abort_directory() {
echo "Error: directory 'rfx' already exists."
echo "Please remove the directory and try again..."
exit 1
}
[[ $# == 0 ]] && abort_argv
[[ -d "./rfx" ]] && abort_directory
SHA=$1
clone_rfx() {
echo "----- Clone RFX"
git clone https://github.com/andyl/rfx.git
}
checkout_sha() {
echo "----- Checkout SHA $SHA"
cd rfx
git checkout $SHA
}
get_deps() {
echo "----- Get project dependencies"
mix deps.get
}
run_tests() {
echo "----- Run tests"
mix test --exclude pending
}
clone_rfx && checkout_sha && get_deps && run_tests && echo "----- DONE"