forked from common-workflow-language/cwltool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jenkins.bash
executable file
·45 lines (45 loc) · 1.33 KB
/
jenkins.bash
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
#!/bin/bash
if [ "$JENKINS_URL" == ""]
then
echo "Looks like we're not being run by Jenkins, this is dangerous"
echo "due to use of git clean -fdx command."
exit 1
fi
cloneorpull() {
if test -d "$1" ; then
(cd "$1" && git pull)
else
git clone "$2"
fi
}
venv() {
if ! test -d "$1" ; then
virtualenv "$1"
fi
# shellcheck source=/dev/null
source "$1"/bin/activate
}
git clean --force -d -x || /bin/true
cloneorpull common-workflow-language https://github.com/common-workflow-language/common-workflow-language.git
venv cwltool-venv
docker pull node:slim
export PIP_DOWNLOAD_CACHE=/var/lib/jenkins/pypi-cache/
pip install -U setuptools wheel pip
python setup.py install
pip install "cwltest>=1.0.20160825151655"
pushd common-workflow-language
git clean --force -d -x || /bin/true
# shellcheck disable=SC2154
if [[ "$version" = *dev* ]]
then
EXTRA="EXTRA=--enable-dev"
fi
./run_test.sh --junit-xml=result.xml RUNNER=cwltool -j4 DRAFT="${version}" ${EXTRA}
CODE=$?
popd
if [ "$GIT_BRANCH" = "origin/master" ] && [[ "$version" = "v1.0" ]]
then
./build-cwl-docker.sh && docker push commonworkflowlanguage/cwltool_module && docker push commonworkflowlanguage/cwltool
fi
#docker rm -v $(docker ps -a -f status=exited | sed 's/ */ /g' | cut -d' ' -f1)
exit ${CODE}