-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
executable file
·61 lines (49 loc) · 1.21 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
#!/bin/bash
set -e
INPUT_CLOUD_SECRET_ID=$1
INPUT_CLOUD_SECRET_KEY=$2
INPUT_CLOUD_ENV_ID=$3
if [ -z "$INPUT_CLOUD_SECRET_ID" ]
then
echo "You must provide your tencent secret id"
exit 1
fi
if [ -z "$INPUT_CLOUD_SECRET_KEY" ]
then
ehco "You must provide your tencent secret key"
exit 1
fi
if [ -z "$INPUT_CLOUD_ENV_ID" ]
then
echo "You must provide your environment id"
fi
# Install hexo env
echo "Installing hexo-cli successfully"
npm install hexo-cli -g
echo "npm instal hexo-cli successfully"
# Install other dependencies
if [ ! -f "packeage.json" ]
then
echo "You must provide package.json file which help install dependencies"
exit 1
fi
echo "Installing Other dependencies"
npm install
echo "Other dependencies install successfully"
# Build hexo
echo "Building hexo"
hexo g
echo "Hexo build successfully"
# Install
echo "Install cloudbase/cli "
npm install -g @cloudbase/cli --loglevel=error
echo "Cloudbase/cli install successfully"
# Login
cd public
echo "Login tcb"
tcb login --apiKeyId ${INPUT_CLOUD_SECRET_ID} --apiKey ${INPUT_CLOUD_SECRET_KEY}
echo "Tcb login successfully"
# Deploy
echo "Deploy successfully"
tcb hosting deploy ./ -e ${INPUT_CLOUD_ENV_ID}
echo "Deploy successfully"