forked from maxhutch/libxsmm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.env
56 lines (48 loc) · 1.59 KB
/
.travis.env
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
#!/bin/sh
#
# This script is setting up a general environment providing:
# TESTSIZE, JOBID, COVID, and an UPLOAD command.
#
SSHPASSBIN=$(which sshpass 2> /dev/null)
UNAME=$(which uname 2> /dev/null)
XARGS=$(which xargs 2> /dev/null)
SCP=$(which scp 2> /dev/null)
GIT=$(which git 2> /dev/null)
TAR=$(which tar 2> /dev/null)
RM=$(which rm 2> /dev/null)
SCPOPT="-q -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oConnectTimeout=10"
if [ "${TRAVIS_BUILD_DIR}" = "" ]; then
export TRAVIS_BUILD_DIR=.
fi
if [ "" = "${TRAVIS_OS_NAME}" ] && [ "" != "${UNAME}" ]; then
export TRAVIS_OS_NAME=$(${UNAME})
fi
if [ "${TRAVIS_OS_NAME}" != "osx" ]; then
export TESTSIZE=500
else
export TESTSIZE=10
fi
if [ "${TRAVIS_JOB_NUMBER}" != "" ]; then
export JOBID=$(echo ${TRAVIS_JOB_NUMBER} | cut -d. -f2)
else
export JOBID=0
fi
if [ "${COVID}" = "" ]; then
export COVID=0
fi
if [ "${SSHPASSBIN}" != "" ] && [ "${XARGS}" != "" ] && [ "${SCP}" != "" ] && [ "${GIT}" != "" ] && [ "${TAR}" != "" ] && [ "${RM}" != "" ] && \
[ "${UPLOAD_KEY}" != "" ] && [ "${UPLOAD_USR}" != "" ] && [ "${UPLOAD_URL}" != "" ]; then
export UPLOAD="if [ -d \${UPLOAD_DIR} ]; then \
UPLOAD_FILE=artifact-\${JOBID}-\${COVID}.tgz && \
tar cfz \${UPLOAD_FILE} \${UPLOAD_DIR} || true; \
fi && \
if [ -e \${UPLOAD_FILE} ]; then \
${SSHPASSBIN} -p \${UPLOAD_KEY} ${SCP} ${SCPOPT} \
\${UPLOAD_FILE} \${UPLOAD_USR}@\${UPLOAD_URL} || true; \
${RM} \${UPLOAD_FILE}; \
else \
>&2 echo \"UPLOAD_DIR or UPLOAD_FILE is not specified!\"; \
fi"
else
>&2 echo "UPLOAD command is not available!"
fi