aboutsummaryrefslogtreecommitdiffstats
path: root/jjb/common/include-apps-prepare-upload-folder-merged.sh
blob: 2847a7bdd89fcad59fa9898d94ea3e49a8e1ef82 (plain)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash

#set -x
set -e

echo -e "\n\n\n"
echo "#########################################"
echo -e "\n\n\n"

#failsafe
if test x"" = x"${AGLBRANCH}" ; then
  echo "AGLBRANCH not defined"
  exit 1
fi
if test x"" = x"${MYPROJECT}"; then
  echo "MYPROJECT not defined"
  exit 1
fi
if test x"" = x"${BUILD_NUMBER}"; then
  echo "BUILD_NUMBER not defined"
  exit 1
fi
if test x"" = x"${GERRIT_CHANGE_NUMBER}"; then
  echo "GERRIT_CHANGE_NUMBER not defined"
  exit 1
fi
if test x"" = x"${TARGETARCH}"; then
  echo "TARGETARCH is not defined"
  exit 1
fi

# construct upload folder
#mv UPLOAD UPLOAD2 || true
rm -rf UPLOAD/* || true

PROJECTDIR="${AGLBRANCH}/${MYPROJECT}/${TARGETARCH}/"
PROJECTPATTERN="${PROJECTDIR}/changeset-${GERRIT_CHANGE_NUMBER}"

mkdir -p UPLOAD/${PROJECTPATTERN}
ln -sf changeset-${GERRIT_CHANGE_NUMBER} UPLOAD/${PROJECTDIR}/latest
export DEST=$(pwd)/UPLOAD/${PROJECTPATTERN}

# copy the wgt to the upload folder
pushd ${MYPROJECT}
pwd

if test x"$isAUTOBUILD" = x"1" ; then
  echo "isAUTOBUILD"
  if [ "$(ls -l package/*.wgt | wc -l)" = "1" ] ; then
    # use just ./package/ for wgt's
    ls package || true
    cp package/*.wgt $DEST
  elif [ "$(ls -l build/package/*.wgt | wc -l)" = "1" ] ; then
    # use just ./build/package/ for wgt's
    ls build/package || true
    cp build/package/*.wgt $DEST
  fi
fi

######################################################################
# /!\/!\/!\   DEPRECATED FALLBACK WAY TO BUILD AGL APPS /!\/!\/!\    #
######################################################################

if test x"$isCMAKE" = x"1" ; then
  echo "isCMAKE"
  # use cmake build/package folder for wgt's ...
  ls build/package/ || true
  cp build/package/*.wgt $DEST
fi
if test x"$isMAKE" = x"1" ; then
    echo "isMAKE"
    # use just ./package/ for wgt's
    ls package || true
    cp package/*.wgt $DEST
fi
if test x"$isQMAKE" = x"1" ; then
    echo "isQMAKE"
    # use just ./package/ for wgt's
    ls package || true
    cp package/*.wgt $DEST
fi

popd