I create bitbucket pipelines for ssh to my server and run sh script that use `gcloud` command but I got message:
`/home/...../deploy-script.sh: line 7: gcloud: command not found`
In my server I install google-cloud sdk already, when I ssh to my server (not from bitbucket pipelines) I can use `gcloud` command.
This is some of bitbucket pipelines
image: atlassian/default-image:2
definitions:
services:
docker:
memory: 3072
pipelines:
branches:
master:
- step:
name: Deploy to GCP VM
script:
- echo "Start deploy to GCP VM"
- pipe: atlassian/ssh-run:0.4.2
variables:
SSH_USER: $SSH_USER
SERVER: $SSH_HOST
COMMAND: '/home/...../deploy-script.sh'
This is some of deploy-script.sh
#!/bin/bash
work_directory="$(dirname "$(realpath "$0")")"
cd $work_directory
echo "Logging in to GCP GCR....."
docker login -u oauth2accesstoken -p "$(gcloud auth print-access-token)" https://asia.gcr.io
How i can fix this?
Sorry for my bad english.