-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
46 lines (37 loc) · 1.74 KB
/
.travis.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
# Use Dockerized infrastructure
sudo: false
# Use node_js environnement
language: node_js
node_js:
- "6.9.1"
# Cache Gcloud SDK between commands
cache:
yarn: true
directories:
- "$HOME/google-cloud-sdk/"
env:
global:
install:
- npm install
script:
- npm test
before_deploy:
- if [ ! -d "$HOME/google-cloud-sdk/bin" ]; then rm -rf $HOME/google-cloud-sdk; export CLOUDSDK_CORE_DISABLE_PROMPTS=1; curl https://sdk.cloud.google.com | bash; fi
- source /home/travis/google-cloud-sdk/path.bash.inc
- gcloud --quiet version
- gcloud --quiet components update
# use the decrypted service account credentials to authenticate the command line tool
# get the encrypted variable names from travis cli: https://docs.travis-ci.com/user/encrypting-files/
- openssl aes-256-cbc -K $encrypted_e82afbcd63e2_key -iv $encrypted_e82afbcd63e2_iv -in gcloud-service-key.json.enc -out gcloud-service-key.json -d
- gcloud auth activate-service-account --key-file gcloud-service-key.json
#ADD YOUR PROJECT ID HERE -- this can be found on the On the Google Cloud Platform Dahsboard under 'Project info'
- gcloud config set project r-spacex-ai
deploy:
- provider: script
script:
# change FUNCTION_NAME PROJECT and REPO to the values from the cloud console: https://console.cloud.google.com/code/develop. Note function name is from your main file, usualy index.js, the main function exports.FUNCTION_NAME
- gcloud --quiet beta functions deploy SpaceXFulfillment --source https://source.developers.google.com/projects/r-spacex-ai/repos/r-SpaceX-AI-google-source-repo/moveable-aliases/master --trigger-http
#- gcloud --quiet beta functions call SpaceXFulfillment --data "$(< requestExample.json)"
skip_cleanup: true
on:
branch: master