-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauto-deploy-predix.sh
More file actions
executable file
·71 lines (60 loc) · 1.67 KB
/
auto-deploy-predix.sh
File metadata and controls
executable file
·71 lines (60 loc) · 1.67 KB
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
######################################################
#This is the script to automatically deploy the sample
#application to your Predix environment.
#
#created by T.Yamada
#last update 27/8/2018
######################################################
#!/bin/bash
CUR=`pwd`
appname=$*
function cli_check(){
if [ "$?" -eq 1 ];then
echo "Message: Some error occurs."
echo "Abnormal end!"
exit
fi
}
# check if the argument is suitable or not
function args_check(){
if [ "$#" -ne 1 ];then
echo "Usage:"
echo " $0 [sub-domain name]"
exit
fi
}
#creating the manifest file
#procedure
#(1) remove manifest file
#(2) create the new manifest file according to the argument.
function create_manifest(){
echo "****creating manifest file start!****"
rm -rf $CUR/manifest.yml
echo "---" >> $CUR/manifest.yml
echo "applications:" >> $CUR/manifest.yml
echo " - name: " $1 >> $CUR/manifest.yml
echo " memory: 256MB" >> $CUR/manifest.yml
echo " buildpack: staticfile_buildpack" >> $CUR/manifest.yml
echo "****creating manifest file done!****"
}
#pushing sample application to your predix environment
#procedure
#(1) change direcory to modules
#(2) push using the manifest file
function push(){
echo "****pushing sample application start!****"
cd $CUR/modules
cf push -f $CUR/manifest.yml
cli_check
echo "****pushing sample application done!****"
}
#show deployed information
function show_results(){
echo -e "\n[Deployed information]"
echo "Auto-deployment to your predix environment is done!"
echo "You can access https://"$1".run.aws-usw02-pr.ice.predix.io"
}
args_check ${appname}
create_manifest ${appname}
push
show_results ${appname,,}