aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/deploy.sh
blob: 0dd0524e68ab1c0080fb7b04092af3a50b836ef8 (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
#!/bin/bash

set -x

########## Define parameters ##########
VERSION="1.0.0-SNAPSHOT"

PATH_TO_BOOT="/w/workspace/demo-master-merge-java/boot"
PATH_TO_HEAT="/w/workspace/demo-master-merge-java/heat"
PATH_TO_VFW="/w/workspace/demo-master-merge-java/vnfs/vFW/scripts"
PATH_TO_VLB="/w/workspace/demo-master-merge-java/vnfs/vLB/scripts"

BOOT_GROUP_ID="org.openecomp.demo.boot"
HEAT_GROUP_ID="org.openecomp.demo.heat"
VFW_GROUP_ID="org.openecomp.demo.vnfs.vfw"
VLB_GROUP_ID="org.openecomp.demo.vnfs.vlb"

REPO_URL="https://nexus.openecomp.org/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")
NETRC=$(mktemp)
echo "machine nexus.openecomp.org login ${USER} password ${PASS}" > "${NETRC}"
#######################################

##### Upload scripts into Nexus raw repository #####
cd $PATH_TO_BOOT
ls | xargs -I{} curl -vk --netrc-file "${NETRC}" --upload-file {} $REPO_URL/$BOOT_GROUP_ID/$VERSION/{}

cd $PATH_TO_HEAT
ls | xargs -I{} curl -vk --netrc-file "${NETRC}" --upload-file {} $REPO_URL/$HEAT_GROUP_ID/$VERSION/{}

cd $PATH_TO_VFW
ls | xargs -I{} curl -vk --netrc-file "${NETRC}" --upload-file {} $REPO_URL/$VFW_GROUP_ID/$VERSION/{}

cd $PATH_TO_VLB
ls | xargs -I{} curl -vk --netrc-file "${NETRC}" --upload-file {} $REPO_URL/$VLB_GROUP_ID/$VERSION/{}
####################################################

########## Clean up ##########
rm ${NETRC}
##############################