-
Notifications
You must be signed in to change notification settings - Fork 0
/
amplify.yml
46 lines (46 loc) · 2.63 KB
/
amplify.yml
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
version: 1
backend:
phases:
build:
commands:
- '# Execute Amplify CLI with the helper script'
- amplifyPush --simple
postBuild:
commands:
- yum install -y jq
- export AWSREGION=$(aws configure get region)
- export AWSACCOUNTID=$(aws sts get-caller-identity --query Account --output text)
- export PROJECT_NAME=$(cat ./amplify/.config/project-config.json | jq -r '.projectName')
- export VUE_APP_MAP=$(aws ssm get-parameter --name /amplify/${PROJECT_NAME}/map --query Parameter.Value --output text)
- echo VUE_APP_MAP=${VUE_APP_MAP} >> .env
- export VUE_APP_TRACKER=$(aws ssm get-parameter --name /amplify/${PROJECT_NAME}/tracker --query Parameter.Value --output text)
- echo VUE_APP_TRACKER=${VUE_APP_TRACKER} >> .env
- export VUE_APP_PLACE=$(aws ssm get-parameter --name /amplify/${PROJECT_NAME}/place --query Parameter.Value --output text)
- echo VUE_APP_PLACE=${VUE_APP_PLACE} >> .env
- export VUE_APP_GEOFENCE=$(aws ssm get-parameter --name /amplify/${PROJECT_NAME}/geofence --query Parameter.Value --output text)
- echo VUE_APP_GEOFENCE=${VUE_APP_GEOFENCE} >> .env
- export VUE_APP_ROUTE=$(aws ssm get-parameter --name /amplify/${PROJECT_NAME}/route --query Parameter.Value --output text)
- echo VUE_APP_ROUTE=${VUE_APP_ROUTE} >> .env
- export VUE_APP_APIURL=$(aws ssm get-parameter --name /amplify/${PROJECT_NAME}/apiUrl --query Parameter.Value --output text)
- echo VUE_APP_APIURL=${VUE_APP_APIURL} >> .env
- cat .env
- export AMPLIFYROLENAME=$(cat ./amplify/#current-cloud-backend/amplify-meta.json | jq -r '.providers.awscloudformation.AuthRoleName')
- export LOCATION_POLICY=$(aws iam list-policies --query 'Policies[*].[PolicyName]' --scope Local --output text | grep -i ${PROJECT_NAME}-location)
- if [ -z $LOCATION_POLICY ]; then aws iam create-policy --policy-name ${PROJECT_NAME}-location --policy-document file://location-policy.json; fi
- export LOCATION_ROLE_POLICY=$(aws iam list-attached-role-policies --role-name ${AMPLIFYROLENAME} --query 'AttachedPolicies[*].[PolicyName]' --output text | grep -i ${PROJECT_NAME}-location)
- if [ -z $LOCATION_ROLE_POLICY ]; then aws iam attach-role-policy --role-name ${AMPLIFYROLENAME} --policy-arn arn:aws:iam::${AWSACCOUNTID}:policy/${PROJECT_NAME}-location; fi
frontend:
phases:
preBuild:
commands:
- npm install
build:
commands:
- npm run build
artifacts:
baseDirectory: dist
files:
- '**/*'
cache:
paths:
- node_modules/**/*