Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Not able to install GCP gcloud package

Edited
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.
Oct 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