Skip to content

Instantly share code, notes, and snippets.

@Klerith
Last active November 1, 2024 15:58
Show Gist options
  • Save Klerith/07371087699cbcdf50b748aa398e8443 to your computer and use it in GitHub Desktop.
Save Klerith/07371087699cbcdf50b748aa398e8443 to your computer and use it in GitHub Desktop.
Google Cloud - Build steps
steps:
- name: "gcr.io/cloud-builders/docker"
args:
[
"build",
"-t",
"XXXXX-docker.pkg.dev/project-name/registry/image-name",
"-f",
"dockerfile.prod",
"--platform=linux/amd64",
".",
]
- name: "gcr.io/cloud-builders/docker"
args:
[
"push",
"XXXXX-docker.pkg.dev/project-name/registry/image-name",
]
@dpaul20
Copy link

dpaul20 commented Jun 20, 2024

No se si a alguno le ha pasado que le falla el build
Tu compilación no se pudo ejecutar: generic::invalid_argument: if 'build.service_account' is specified, the build must either (a) specify 'build.logs_bucket', (b) use the REGIONAL_USER_OWNED_BUCKET build.options.default_logs_bucket_behavior option, or (c) use either CLOUD_LOGGING_ONLY / NONE logging options
image

por ahora he solucionado con esto
https://stackoverflow.com/questions/68779751/error-publishing-source-code-from-cloud-build-to-a-bucket-using-triggers

@Alejgl04
Copy link

Como lo solucionaste?

@patriciobo
Copy link

Gracias @dpaul20 !

@Alejgl04 la solución es copiar esta instruccion al final del archivo, a la misma altura de "steps"

options:
logging: CLOUD_LOGGING_ONLY

El archivo deberia quedar de la siguiente manera:

steps:
  - name: "gcr.io/cloud-builders/docker"
    args:
      [
        "build",
        "-t",
        "XXXXX-docker.pkg.dev/project-name/registry/image-name",
        "-f",
        "dockerfile.prod",
        "--platform=linux/amd64",
        ".",
      ]
  - name: "gcr.io/cloud-builders/docker"
    args:
      [
        "push",
        "XXXXX-docker.pkg.dev/project-name/registry/image-name",
      ]
options:
  logging: CLOUD_LOGGING_ONLY

@Alejgl04
Copy link

Gracias perfecto !! funciono

@Nullises
Copy link

Gracias @patriciobo Funciono perfecto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment