-
Notifications
You must be signed in to change notification settings - Fork 4
/
build-release.sh
executable file
·41 lines (29 loc) · 1.27 KB
/
build-release.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
#!/bin/bash
set -euxo pipefail
which rustup
rustup target add x86_64-unknown-linux-musl
cargo build --release --target=x86_64-unknown-linux-musl --bin librarian --bin server
RELEASE_PATH="release"
mkdir -p $RELEASE_PATH
# get the version number
VERSION=$(cargo run --release --bin librarian -- --version | awk '{print $NF}')
DIRNAME="librarian_v$VERSION"
# c creates an archive
# z tells it to use gzip
# f tells it the archive to save to
# s sends the filename to sed with the given commands
# -C changes directory, affects subsequent directory changes as well
tar --overwrite --transform "s,^,$DIRNAME/," -czf $RELEASE_PATH/librarian.tar.gz -C server scripts -C ../target/x86_64-unknown-linux-musl/release librarian
tar --overwrite --transform "s,^,$DIRNAME/," -czf $RELEASE_PATH/server.tar.gz -C server scripts -C ../target/x86_64-unknown-linux-musl/release server
cd frontend/example_inputs/
unzip -o example_inputs.zip # -o overwrites existing files
cd -
cd $RELEASE_PATH
tar -xf librarian.tar
./$DIRNAME/librarian ../frontend/example_inputs/example_inputs/ATAC.example.fastq --local --raw --output-dir=.
# check whether the files are non-empty
test -s librarian_heatmap.txt
# check whether the files are recent
test `find librarian_heatmap.txt -mmin -1`
rm librarian_heatmap.txt
cd -