Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab Cloud run deploy successfully but Job failed

Im having an issue with my CI/CD pipeline , its successfully deployed to GCP cloud run but on Gitlab dashboard the status is failed.

I tried to replace images to some other docker images but it fails as well .

 # File: .gitlab-ci.yml
image: google/cloud-sdk:alpine
deploy_int:
  stage: deploy
  environment: integration
  only:
  - integration    # This pipeline stage will run on this branch alone
  script:
    - echo $GCP_SERVICE_KEY > gcloud-service-key.json # Google Cloud service accounts
    - gcloud auth activate-service-account --key-file gcloud-service-key.json
    - gcloud config set project $GCP_PROJECT_ID
    - gcloud builds submit . --config=cloudbuild_int.yaml




# File: cloudbuild_int.yaml
steps:
    # build the container image
  - name: 'gcr.io/cloud-builders/docker'
    args: [ 'build','--build-arg','APP_ENV=int' , '-t', 'gcr.io/$PROJECT_ID/tpdropd-int-front', '.' ]
    # push the container image
  - name: 'gcr.io/cloud-builders/docker'
    args: [ 'push', 'gcr.io/$PROJECT_ID/tpdropd-int-front']
    # deploy to Cloud Run
  - name: "gcr.io/cloud-builders/gcloud"
    args: ['run', 'deploy', 'tpd-front', '--image', 'gcr.io/$PROJECT_ID/tpdropd-int-front', '--region', 'us-central1', '--platform', 'managed', '--allow-unauthenticated']

gitlab build output :

ERROR: (gcloud.builds.submit) 
The build is running, and logs are being written to the default logs bucket.
This tool can only stream logs if you are Viewer/Owner of the project and, if applicable, allowed by your VPC-SC security policy.
The default logs bucket is always outside any VPC-SC security perimeter.
If you want your logs saved inside your VPC-SC perimeter, use your own bucket.
See https://cloud.google.com/build/docs/securing-builds/store-manage-build-logs.
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
like image 961
MIkCode Avatar asked May 09 '26 10:05

MIkCode


1 Answers

I fix it by using:

options:
  logging: CLOUD_LOGGING_ONLY

in cloudbuild.yaml

like image 107
Kevin Avatar answered May 11 '26 16:05

Kevin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!