I have a pipeline on Bitbucket which deploys an nginx service to the Cloud Run service.
deploy-cloud-run:
- step:
name: Build and Deploy Application
caches:
- node
services:
- docker
script:
# Build the application
- npm install
- npm run build
# Set a couple variables for readability
- CLI_VERSION=466.0.0
- CLI_FILENAME=google-cloud-cli-${CLI_VERSION}-linux-x86_64.tar.gz
# Install Google Cloud CLI
- curl -o /tmp/google-cloud-cli.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/${CLI_FILENAME}
- tar -xvf /tmp/google-cloud-cli.tar.gz -C /tmp/
- /tmp/google-cloud-sdk/install.sh -q
- source /tmp/google-cloud-sdk/path.bash.inc
- gcloud -v
# Authenticating with the service account key file
- echo $BITBUCKET_SERVICE_ACCOUNT | base64 --decode --ignore-garbage > ./gcloud-api-key.json
- gcloud auth activate-service-account --key-file gcloud-api-key.json
- gcloud auth configure-docker us-docker.pkg.dev
# Pushing the docker image
- docker build . -t website
- docker tag website us-docker.pkg.dev/<project_id>/website-nginx/website:latest
- docker push us-docker.pkg.dev/<project_id>/website-nginx/website:latest
- gcloud run deploy website --image us-docker.pkg.dev/<project_id>/website-nginx/website:latest --project <project_id> --region us-central1 --port 80 --memory 512Mi --cpu 1
However, it seems that the command gcloud auth configure-docker us-docker.pkg.dev
just hangs in a frozen state without any feedback. This used to work before (the pipeline last ran about 10 days ago). There has been no recent changes on the Google Cloud Platform project.
I tried creating a new key for the service account. I’ve also double checked the permissions. It is strange as there has been no recent changes on the Google Cloud Platform project.
Alexander Abraham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.