-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·64 lines (55 loc) · 1.56 KB
/
entrypoint.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
#!/bin/sh
######################################################################################
# Command: #
# run -e PLAYGROUND_PAT=... "application_path" "namespace" "application_name" "tag" #
######################################################################################
## get args
debug=$1
appPath=$2
namespace=$3
appName=$4
tag=$5
configFile=$6
## check args
if [[ -z "$appPath" ]]; then
echo "applicationPath can not be empty"
exit 1
fi
if [[ -z "$namespace" ]]; then
echo "namespace can not be empty"
exit 1
fi
if [[ -z "$appName" ]]; then
echo "applicationName can not be empty"
exit 1
fi
if [[ -z "$tag" ]]; then
echo "tag can not be empty"
exit 1
fi
#############################
# if there is a configFile...
if [[ -n "$configFile" ]]; then
echo "using custom installation from $configFile "
mkdir -p /napptive
cp ${configFile} /napptive/.playground.yaml
if [[ $? -ne 0 ]]; then
exit 1
fi
export PLAYGROUND_CONFIG=/napptive/
echo "PLAYGROUND_CONFIG env added: $PLAYGROUND_CONFIG"
fi
# Step 1. Login in to the platform
# Login into the platform (with pat flag)
/app/playground login --pat --debug=$debug
if [[ $? -ne 0 ]]; then
exit 1
fi
# push the app
# playground catalog push <namespace/appName[:tag]> <application_path> [flags]
appFullName="${namespace}/${appName}:${tag}"
echo "Pushing ${appFullName}"
/app/playground catalog push ${appFullName} ${appPath} --debug=$debug
if [[ $? -ne 0 ]]; then
exit 1
fi