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 pathdeploy_author_publish.sh
111 lines (86 loc) · 1.98 KB
/
deploy_author_publish.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
#!/bin/sh
# defaultconfig
sling_url_author="http://localhost:4502"
sling_url_publish="http://localhost:4503"
sling_user="admin"
sling_password="admin"
conga_node_author="aem-author"
conga_node_publish="aem-publish"
####
default_build()
{
motd
clean_install
deploy_artifacts
}
#####
motd()
{
echo "********************************************************************"
echo ""
echo " Cleans and installs all modules"
echo " Uploads and installs application complete packages, config and sample content"
echo ""
echo " Destinations:"
echo " - $conga_node_author: $sling_url_author"
echo " - $conga_node_publish: $sling_url_publish"
echo ""
echo "********************************************************************"
}
####
clean_install()
{
echo ""
echo "*** Build artifacts ***"
echo ""
mvn clean install eclipse:eclipse
if [ "$?" -ne "0" ]; then
error_exit "*** Build artifacts FAILED ***"
fi
}
#####
deploy_artifacts()
{
echo ""
echo "*** Deploy AEM packages (author) ***"
echo ""
cd config-definition
mvn -B -Dsling.url=$sling_url_author \
-Dsling.user=$sling_user -Dsling.password=$sling_password \
-Dconga.nodeDirectory=target/configuration/development/$conga_node_author \
conga-aem:package-install
if [ "$?" -ne "0" ]; then
error_exit "*** Deploying AEM packages FAILED ***"
fi
cd ../
echo ""
echo "*** Deploy AEM packages (publish) ***"
echo ""
cd config-definition
mvn -B -Dsling.url=$sling_url_publish \
-Dsling.user=$sling_user -Dsling.password=$sling_password \
-Dconga.nodeDirectory=target/configuration/development/$conga_node_publish \
conga-aem:package-install
if [ "$?" -ne "0" ]; then
error_exit "*** Deploying AEM packages FAILED ***"
fi
cd ../
}
#####
error_exit()
{
echo ""
echo "$1" 1>&2
echo ""
if [[ $0 == *":\\"* ]]; then
read -n1 -r -p "Press ENTER key to continue..."
fi
exit 1
}
default_build
echo ""
echo "*** Build complete ***"
echo ""
if [[ $0 == *":\\"* ]]; then
read -n1 -r -p "Press ENTER key to continue..."
fi