-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitbucket-pipelines.yml
41 lines (40 loc) · 1.58 KB
/
bitbucket-pipelines.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
image: node:10.15.1
pipelines:
pull-requests:
'**':
- step:
name: 'Test and build'
caches:
- node
script:
- npm ci
- npm test
- npm run build
branches:
master:
- step:
name: 'Deploy Firebase Rules'
deployment: firebase-prod
caches:
- node
script:
- npm install -g firebase-tools
- firebase deploy --only firestore --token=$FIREBASE_TOKEN --project=$FIREBASE_PROJECT --non-interactive
- step:
name: 'Deploy to now'
deployment: now-prod
caches:
- node
script:
# In order to get env variables from bitbucket all the way to react-scripts
# we need to create an actual .env file
- touch .env.production
- echo "REACT_APP_FIREBASE_API_KEY=$FIREBASE_API_KEY" >> .env.production
- echo "REACT_APP_FIREBASE_AUTH_DOMAIN=$FIREBASE_AUTH_DOMAIN" >> .env.production
- echo "REACT_APP_FIREBASE_DATABASE_URL=$FIREBASE_DATABASE_URL" >> .env.production
- echo "REACT_APP_FIREBASE_PROJECT_ID=$FIREBASE_PROJECT_ID" >> .env.production
- echo "REACT_APP_FIREBASE_STORAGE_BUCKET=$FIREBASE_STORAGE_BUCKET" >> .env.production
- echo "REACT_APP_FIREBASE_MESSAGING_SENDER_ID=$FIREBASE_MESSAGING_SENDER_ID" >> .env.production
- echo "REACT_APP_FIREBASE_APP_ID=$FIREBASE_APP_ID" >> .env.production
- npm install -g [email protected]
- now --token=$NOW_TOKEN --target production