bitbucket-pipelines.yml
image: node:8.9.4
pipelines:
default:
- step:
caches:
- node
script:
# SETUP AND TESTS
- ./test.sh
# BUILD APPLICATION
- ember build --environment=production
# DEPLOY APPLICATION
- cd dist && gcloud app deploy app.yaml -q --version production
test.sh
# INSTALL GOOGLE CLOUD SDK
curl -s -o /tmp/google-cloud-sdk.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-191.0.0-linux-x86_64.tar.gz
tar -xzf /tmp/google-cloud-sdk.tar.gz -C /tmp/
/tmp/google-cloud-sdk/install.sh -q
source /tmp/google-cloud-sdk/path.bash.inc
# SETUP GOOGLE CLOUD SDK
echo $GCLOUD_SERVICE_KEY | base64 --decode > /tmp/gcloud-service-key.json
gcloud auth activate-service-account --key-file /tmp/gcloud-service-key.json
gcloud config set project cmg-frontend
# INSTALL REQUIREMENTS FOR BUILDING
npm install -g ember-cli
# INSTALL REQUIREMENTS FOR TESTING
npm install phantomjs-prebuilt
# INSTALL REQUIREMENTS FOR APP
npm install
# RUN TESTS
ember test
I get this error:
+ cd dist && gcloud app deploy app.yaml -q --version production
bash: gcloud: command not found
But gcloud command works fine inside test.sh (successful auth and project config).
What am I missing?
Thanks!