Skip to content

Commit f7b0889

Browse files
committed
add compile and hbb scripts
1 parent 178ffcf commit f7b0889

2 files changed

Lines changed: 112 additions & 0 deletions

File tree

scripts/compile.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
set -e
3+
4+
branch=$1
5+
version=$2
6+
7+
echo "Building rapmap [branch = ${branch}]. Tagging version as ${version}"
8+
9+
# Activate Holy Build Box environment.
10+
source /hbb_exe/activate
11+
12+
set -x
13+
14+
# Install things we need
15+
yum install -y --quiet wget
16+
wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
17+
rpm -i --quiet epel-release-5-4.noarch.rpm
18+
#yum install -y --quiet git
19+
#yum install -y --quiet xz-devel.x86_64
20+
#yum install -y --quiet bzip2-devel.x86_64
21+
yum install -y --quiet unzip
22+
23+
curl -k -L https://github.com/COMBINE-lab/RapMap/archive/${branch}.zip -o ${branch}.zip
24+
unzip ${branch}.zip
25+
mv RapMap-${branch} RapMap
26+
cd RapMap
27+
mkdir build
28+
cd build
29+
cmake -DFETCH_BOOST=TRUE ..
30+
make
31+
make install
32+
make test
33+
cd ../scripts
34+
bash make-release.sh -v ${version} -n CentOS5
35+
cd ../RELEASES
36+
cp *.tar.gz /io/

scripts/make-release.sh

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/bin/bash
2+
3+
SOURCE="${BASH_SOURCE[0]}"
4+
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
5+
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
6+
SOURCE="$(readlink "$SOURCE")"
7+
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
8+
done
9+
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
10+
11+
host=
12+
version=
13+
14+
while getopts "v:n:" opt; do
15+
case $opt in
16+
n)
17+
echo "Host is $OPTARG" >&2
18+
host=$OPTARG
19+
;;
20+
v)
21+
echo "Version is $OPTARG" >&2
22+
version=$OPTARG
23+
;;
24+
\?)
25+
echo "Invalid option: -$OPTARG" >&2
26+
exit 1
27+
;;
28+
esac
29+
d``one
30+
31+
echo -e "Preparing binary release\n=====================\n"
32+
echo -e "Version = ${version}"
33+
echo -e "Host = ${host}"
34+
35+
# create the binary directory
36+
betaname=RapMap-${version}_${host}
37+
mkdir ${DIR}/../RELEASES
38+
mkdir ${DIR}/../RELEASES/${betaname}
39+
mkdir ${DIR}/../RELEASES/${betaname}/bin
40+
mkdir ${DIR}/../RELEASES/${betaname}/lib
41+
42+
echo -e "Copying over the binary\n"
43+
cp ${DIR}/../bin/rapmap ${DIR}/../RELEASES/${betaname}/bin/
44+
45+
# copy other dependencies (shared libraries)
46+
#echo -e "Copying over other shared library dependencies\n"
47+
#bash ${DIR}/../scripts/cpld.bash ${DIR}/../bin/salmon ${DIR}/../RELEASES/${betaname}/lib/
48+
#echo -e "Removing dangerous dependencies\n"
49+
#rm ${DIR}/../RELEASES/${betaname}/lib/libc.so.6
50+
#rm ${DIR}/../RELEASES/${betaname}/lib/ld-linux-x86-64.so.2
51+
#rm ${DIR}/../RELEASES/${betaname}/lib/libdl.so.2
52+
#rm ${DIR}/../RELEASES/${betaname}/lib/libpthread*.so.*
53+
54+
# now make the tarball
55+
echo -e "Making the tarball\n"
56+
cd ${DIR}/../RELEASES
57+
tar czvf ${betaname}.tar.gz ${betaname}
58+
59+
echo -e "Done making release!"
60+
61+
#echo -e "Pushing the tarball to GitHub\n"
62+
## Since it's currently unclear to me how to overwrite an asset via the GitHub
63+
## API, the following code deletes the old asset, and uploads the new one in its place
64+
#
65+
## Get the previous asset id of the tarball
66+
#echo -e "Getting previous asset ID\n"
67+
#ASSETID=`curl -s -X GET https://api.github.com/repos/COMBINE-lab/salmon/releases/1263754/assets | grep "\"id" | head -1 | awk '{gsub(/,$/,""); print $2}'`
68+
#
69+
## Delete the previous tarball
70+
#echo -e "Deleting previous asset\n"
71+
#curl -X DELETE -H "Authorization: token ${SALMON_PUSH_KEY}" https://api.github.com/repos/COMBINE-lab/salmon/releases/assets/$ASSETID
72+
#
73+
## Upload the new tarball
74+
#echo -e "Uploading new asset\n"
75+
#curl -X POST --data-binary "@SalmonBeta-latest_ubuntu-12.04.tar.gz" https://uploads.github.com/repos/COMBINE-lab/salmon/releases/1263754/assets?name=SalmonBeta-latest_ubuntu-12.04.tar.gz --header "Content-Type:application/gzip" -H "Authorization: token ${SALMON_PUSH_KEY}"
76+
#echo -e "Done!\n"

0 commit comments

Comments
 (0)