Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gcloud commands cannot be run from your Make image #477

Open
joe-wroe-dft opened this issue Jan 25, 2021 · 0 comments
Open

Gcloud commands cannot be run from your Make image #477

joe-wroe-dft opened this issue Jan 25, 2021 · 0 comments

Comments

@joe-wroe-dft
Copy link

gcr.io/cloud-builders-community/make

Expected Behavior

To be able to use a Makefile that contains gcloud commands (such as the gcloud KMS API) when using this image in our pipeline instead of the Google Cloud provided gcr.io/cloud-builders/gcloud.

Actual Behavior

We set up our pipeline to pull and use the provided gcr.io/cloud-builders-community/make image. When we run our pipeline which contains the following Make task:

	gcloud kms decrypt --location=$(REGION) ... # some more secret flags, shhh!

We find that the gcloud command is not installed on this image.

Steps to Reproduce the Problem

(With the Make image set up correctly in your GCP project)

  1. Add a Makefile to your application that contains a task that runs a gcloud command, e.g.:

In your Makefile

gcloud_help:
    gcloud help
  1. Add a pipeline step to your cloudbuild.yaml that runs this Make command:

In cloudbuild.yaml

steps:
  - id: "cloud help"
    name: gcr.io/$PROJECT_ID/make
    args: 
      - gcloud_help
  1. push and run your pipeline. It should fail with a message similar to the following:

In CloudBuild console

Step #0 - "cloud help": make[1]: gcloud: Command not found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant