forked from stipop-development/stipop-flutter-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pub_login.sh
32 lines (27 loc) · 913 Bytes
/
pub_login.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
if [ -z "${PUB_DEV_PUBLISH_ACCESS_TOKEN}" ]; then
echo "Missing PUB_DEV_PUBLISH_ACCESS_TOKEN environment variable"
exit 1
fi
if [ -z "${PUB_DEV_PUBLISH_REFRESH_TOKEN}" ]; then
echo "Missing PUB_DEV_PUBLISH_REFRESH_TOKEN environment variable"
exit 1
fi
if [ -z "${PUB_DEV_PUBLISH_TOKEN_ENDPOINT}" ]; then
echo "Missing PUB_DEV_PUBLISH_TOKEN_ENDPOINT environment variable"
exit 1
fi
if [ -z "${PUB_DEV_PUBLISH_EXPIRATION}" ]; then
echo "Missing PUB_DEV_PUBLISH_EXPIRATION environment variable"
exit 1
fi
mkdir -p ~/.pub-cache
cat <<EOF > ~/.pub-cache/credentials.json
{
"accessToken":"${PUB_DEV_PUBLISH_ACCESS_TOKEN}",
"refreshToken":"${PUB_DEV_PUBLISH_REFRESH_TOKEN}",
"tokenEndpoint":"${PUB_DEV_PUBLISH_TOKEN_ENDPOINT}",
"idToken":"${PUB_DEV_PUBLISH_ID_TOKEN}",
"scopes":["openid","https://www.googleapis.com/auth/userinfo.email"],
"expiration":${PUB_DEV_PUBLISH_EXPIRATION}
}
EOF