aboutsummaryrefslogtreecommitdiffstats
path: root/script-pgaas-deb-build.sh
blob: f09dd4eb1750cb2a871e3141d140d98b20424ecf (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
#!/bin/bash
# Create a debian package and push to remote repo

[ "$#" != "1" ] && set -- verify
phase="$1"
case $phase in
    verify|merge|release)
	echo "Running $phase job"
	;;
    *)
	echo "Unknown phase $phase"
	exit 1
	;;
esac


#
echo "============== STARTING SCRIPT TO CREATE DEBIAN FILES ================="

export BUILD_NUMBER="${BUILD_ID}"
export PATH="$PATH:${WORKSPACE}/buildtools/bin"
export NEXUS_RAW="${NEXUSPROXY}/content/sites/raw"

USER=$(xpath -q -e \
    "//servers/server[id='ecomp-raw']/username/text()" "$SETTINGS_FILE")
PASS=$(xpath -q -e \
    "//servers/server[id='ecomp-raw']/password/text()" "$SETTINGS_FILE")

# Create a netrc file for use with curl
export NETRC=$(mktemp)
echo "machine nexus.openecomp.org login ${USER} password ${PASS}" > "${NETRC}"

case "$phase" in
	verify|merge ) REPO="${NEXUS_RAW}/org.openecomp.dcae.pgaas/deb-snapshots" ;;
	release ) REPO="${NEXUS_RAW}/org.openecomp.dcae.pgaas/deb-releases" ;;
esac

export REPACKAGEDEBIANUPLOAD="set -x; echo curl -k --netrc-file '${NETRC}' \
    --upload-file '{0}' '${REPO}/{2}-{1}'"
#export REPACKAGEDEBIANUPLOAD3="set -x; echo curl -k --netrc-file '${NETRC}' \
#    --upload-file '{0}' '${REPO}/{2}-{4}-SNAPSHOT.deb'"
export REPACKAGEDEBIANUPLOAD2="set -x; echo curl -k --netrc-file '${NETRC}' \
    --upload-file '{0}' '${REPO}/{2}-{4}.deb'"

case "$phase" in
	verify ) make debian-verify ;;
	merge ) make debian ;;
	release ) make debian ;;
esac

echo "================= ENDING SCRIPT TO CREATE DEBIAN FILES ================="

#echo "============= STARTING SCRIPT TO CREATE JAVADOCS FILES ================"
#make upload-javadocs
#echo "============= ENDING SCRIPT TO CREATE JAVADOCS FILES =================="