-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·63 lines (52 loc) · 1.01 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
63
#!/bin/sh
set -e
export HOME="/github/workspace"
export FLEET_HOME="/github/workspace"
mkdir -p "$HOME/.fleet"
chmod -R 770 "$HOME/.fleet"
export API_TYPE=""
if [ -n "$INPUT_APITOKEN" ]
then
export FLEET_API_TOKEN="$INPUT_APITOKEN"
export API_TYPE="API Token"
fi
if [ -z "$API_TYPE" ]
then
>&2 echo "The personal access token could not be found. Please pass an 'apiToken' as an entry to the action."
exit 1
else
echo "Using $API_TYPE authentication"
fi
if [ -z "$INPUT_PROJECTID" ]
then
echo "Your Fleet project's project id was not found. Please pass an 'projectId' as an entry to the action."
exit 1
else
export FLEET_PROJECT_ID="$INPUT_PROJECTID"
fi
# Install Fleet CLI
npm i @fleetfn/cli -g
if [ -n "$INPUT_WORKINGDIRECTORY" ]
then
cd "$INPUT_WORKINGDIRECTORY"
fi
if [ -z "$INPUT_PROD" ]
then
if [ -z "$INPUT_VERBOSE" ]
then
fleet
else
fleet -v
fi
else
if [ -z "$INPUT_VERBOSE" ]
then
fleet -p
else
fleet -p -v
fi
fi
if [ -n "$INPUT_WORKINGDIRECTORY" ]
then
cd $HOME
fi