Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to install GCP gcloud package

Aditya Dhatingan October 25, 2023
image: maven:3.6.3

pipelines:
- step:
          name: GCP Actions
          script:
            - echo "Performing GCP Branch specific actions"
            - echo "STARTING PUSH"
            - git rev-parse HEAD | tee commit.txt
            - dnf update -y && dnf install -y which curl wget
            - curl https://sdk.cloud.google.com | bash
            - source /root/google-cloud-sdk/path.bash.inc
            - gcloud auth activate-service-account --key-file=gocomet-deployment-qa-sa.json
tried sudo, yum, dnf, apt for all commands the response is just 
sudo: command not found, yum:command not found

1 answer

1 vote
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 26, 2023

Hello @Aditya Dhatingan !

Thank you for reaching out to the Community!

The maven image you are using in the step is based on Oracle Linux so it does not come with package managers such as yum, apt-get, dnf and apk so this is the reason why you are receiving the error command not found. This error is returned when the program you are trying to execute is not installed in the docker image you are using.

Since your end goal seems to be to use gcloud CLI command, I would suggest using the official Google image google/cloud-sdk that already comes with the CLI tool installed.

Your pipeline step would look like below : 

step:
          nameGCP Actions
image: google/cloud-sdk
          script:
            - echo "Performing GCP Branch specific actions"
            - echo "STARTING PUSH"
            - git rev-parse HEAD | tee commit.txt
            - gcloud auth activate-service-account --key-file=gocomet-deployment-qa-sa.json

With this image, it won't be necessary to manually install gcloud CLI as it already comes with the image. You can also explore other images available in DockerHub.

Hope that helps! Let us know in case you have any questions.

Thank you, @Aditya Dhatingan !

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events