This repository has been archived by the owner on Aug 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclean_install_deploy_package.sh
112 lines (87 loc) · 1.74 KB
/
clean_install_deploy_package.sh
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/sh
# defaultconfig
sling_url="http://localhost:4502"
sling_user="admin"
sling_password="admin"
sling_params=""
# set parameter variables before run
init()
{
sling_params="-Dsling.url=$sling_url -Dsling.user=$sling_user -Dsling.password=$sling_password"
other_params=$4
}
####
# run modes
default_build()
{
motd
init
clean_install
deploy_artifacts
}
#####
motd()
{
echo "********************************************************************"
echo ""
echo " Cleans and installs all modules"
echo " Uploads and installs application complete packages and sample content"
echo ""
echo " Destination: $sling_url"
echo ""
echo "********************************************************************"
}
####
clean_install()
{
echo ""
echo "*** Build artifacts ***"
echo ""
mvn $sling_params $other_params clean install eclipse:eclipse
if [ "$?" -ne "0" ]; then
error_exit "*** Build artifacts FAILED ***"
fi
}
#####
deploy_artifacts()
{
echo ""
echo "*** Deploy AEM packages ***"
echo ""
cd content-packages/complete
mvn -B $sling_params wcmio-content-package:install
if [ "$?" -ne "0" ]; then
error_exit "*** Deploying config packages FAILED ***"
fi
cd ../../
cd content-packages/sample-content
mvn -B $sling_params wcmio-content-package:install
if [ "$?" -ne "0" ]; then
error_exit "*** Deploying config packages FAILED ***"
fi
cd ../../
}
#####
error_exit()
{
echo ""
echo "$1" 1>&2
echo ""
read -n1 -r -p "Press any key to continue..." key
exit 1
}
# check params and run
if [ "$1" != "" ]
then
# commandlineconfig
sling_url=$1
sling_user=$2
sling_password=$3
shift 3
other_params=$@
fi
default_build
echo ""
echo "*** Build complete ***"
echo ""
read -n1 -r -p "Press any key to continue..." key