-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·56 lines (46 loc) · 908 Bytes
/
entrypoint.sh
File metadata and controls
executable file
·56 lines (46 loc) · 908 Bytes
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
#!/bin/sh
TOKEN=$1
APP_ID=$2
REGION=$3
VERSION_ID=$4
FORCE=$5
CLIENT=$6
DIR=$7
# Validate that at least one of APP_ID or VERSION_ID is provided
if [ -z "$APP_ID" ] && [ -z "$VERSION_ID" ]; then
echo "::error::Either appId or versionId must be provided to deploy the app. Both cannot be empty."
exit 1
fi
mapps init -t $TOKEN
# Build command arguments conditionally
if [ -z "$APP_ID" ]; then
APP_ID_ARG=""
else
APP_ID_ARG="-a $APP_ID"
fi
if [ -z "$REGION" ]; then
REGION_ARG=""
else
REGION_ARG="-z $REGION"
fi
if [ -z "$VERSION_ID" ]; then
VERSION_ID_ARG=""
else
VERSION_ID_ARG="-i $VERSION_ID"
fi
if [ -z "$FORCE" ]; then
FORCE_ARG=""
else
FORCE_ARG="-f"
fi
if [ -z "$CLIENT" ]; then
CLIENT_ARG=""
else
CLIENT_ARG="-c"
fi
if [ -z "$DIR" ]; then
DIR_ARG=""
else
DIR_ARG="-d $DIR"
fi
mapps code:push $APP_ID_ARG $REGION_ARG $VERSION_ID_ARG $FORCE_ARG $DIR_ARG $CLIENT_ARG