It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Stuck during deploy pipeline for nodejs app targeting google cloud Edited

Castorident Apr 18, 2019

I am testing my first pipeline to deploy a simple nodejs app to google cloud app engine standard environment.

My bitbucket-pipelines.yml :

## YAML Template.image: node:8.11.4
pipelines:
default:
-
step:
name: Deploy
script:
-
pipe: atlassian/google-app-engine-deploy:0.3.1
variables:
KEY_FILE: $KEY_FILE
PROJECT: 'compare-renting-prices'

And the result I get :

+ hg clone --noupdate https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/$BITBUCKET_REPO_FULL_NAME . && hg update -C "059ea1a827d467ce5939c4b50b8d419d57e45874" && test -e bitbucket-pipelines.yml
requesting all changes
adding changesets
adding manifests
adding file changes
added 26 changesets with 72 changes to 18 files
new changesets b99860436ec1:059ea1a827d4
12 files updated, 0 files merged, 0 files removed, 0 files unresolved



+ chmod 777 $BUILD_DIR



+ docker container run \
--volume=/opt/atlassian/pipelines/agent/build:/opt/atlassian/pipelines/agent/build \
--volume=/opt/atlassian/pipelines/agent/ssh:/opt/atlassian/pipelines/agent/ssh:ro \
--volume=/usr/local/bin/docker:/usr/local/bin/docker:ro \
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes \
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/google-app-engine-deploy:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/google-app-engine-deploy \
--workdir=$(pwd) \
--label=org.bitbucket.pipelines.system=true \
--env=CI="$CI" \
--env=BITBUCKET_COMMIT="$BITBUCKET_COMMIT" \
--env=BITBUCKET_BUILD_NUMBER="$BITBUCKET_BUILD_NUMBER" \
--env=BITBUCKET_BRANCH="$BITBUCKET_BRANCH" \
--env=BITBUCKET_PR_DESTINATION_BRANCH="$BITBUCKET_PR_DESTINATION_BRANCH" \
--env=BITBUCKET_PR_DESTINATION_COMMIT="$BITBUCKET_PR_DESTINATION_COMMIT" \
--env=BITBUCKET_PR_ID="$BITBUCKET_PR_ID" \
--env=BITBUCKET_TAG="$BITBUCKET_TAG" \
--env=BITBUCKET_BOOKMARK="$BITBUCKET_BOOKMARK" \
--env=BITBUCKET_REPO_OWNER="$BITBUCKET_REPO_OWNER" \
--env=BITBUCKET_REPO_OWNER_UUID="$BITBUCKET_REPO_OWNER_UUID" \
--env=BITBUCKET_REPO_SLUG="$BITBUCKET_REPO_SLUG" \
--env=BITBUCKET_REPO_UUID="$BITBUCKET_REPO_UUID" \
--env=BITBUCKET_CLONE_DIR="$BITBUCKET_CLONE_DIR" \
--env=BITBUCKET_PARALLEL_STEP="$BITBUCKET_PARALLEL_STEP" \
--env=BITBUCKET_PARALLEL_STEP_COUNT="$BITBUCKET_PARALLEL_STEP_COUNT" \
--env=BITBUCKET_GIT_HTTP_ORIGIN="$BITBUCKET_GIT_HTTP_ORIGIN" \
--env=BITBUCKET_GIT_SSH_ORIGIN="$BITBUCKET_GIT_SSH_ORIGIN" \
--env=PIPELINES_JWT_TOKEN="$PIPELINES_JWT_TOKEN" \
--env=BITBUCKET_DOCKER_HOST_INTERNAL="$BITBUCKET_DOCKER_HOST_INTERNAL" \
--env=DOCKER_HOST="tcp://host.docker.internal:2375" \
--env=BITBUCKET_PIPE_SHARED_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes" \
--env=BITBUCKET_PIPE_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/google-app-engine-deploy" \
--env=KEY_FILE="$KEY_FILE" \
--env=PROJECT="compare-renting-prices" \
--add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \
bitbucketpipelines/google-app-engine-deploy:0.3.1
Unable to find image 'bitbucketpipelines/google-app-engine-deploy:0.3.1' locally
0.3.1: Pulling from bitbucketpipelines/google-app-engine-deploy
8e402f1a9c57: Pulling fs layer
1ba8a7012af5: Pulling fs layer
0444d59b507b: Pulling fs layer
0444d59b507b: Download complete
8e402f1a9c57: Verifying Checksum
8e402f1a9c57: Download complete
8e402f1a9c57: Pull complete
1ba8a7012af5: Download complete
1ba8a7012af5: Pull complete
0444d59b507b: Pull complete
Digest: sha256:4b87f575fe8760971cd89ad392067b2621034f2fae142295317f6a75ad70be9c
Status: Downloaded newer image for bitbucketpipelines/google-app-engine-deploy:0.3.1
INFO: Setting up environment.
echo "${KEY_FILE}" | base64 -d >> /tmp/key-file.json
gcloud auth activate-service-account --key-file /tmp/key-file.json --quiet
Activated service account credentials for: [compare-renting-prices@appspot.gserviceaccount.com]
gcloud config set project compare-renting-prices --quiet
Updated property [core/project].
INFO: Starting deployment to GCP app engine...
gcloud app deploy
Services to deploy:



descriptor: [/opt/atlassian/pipelines/agent/build/app.yaml]
source: [/opt/atlassian/pipelines/agent/build]
target project: [compare-renting-prices]
target service: [default]
target version: [20190418t214107]
target url: [https://compare-renting-prices.appspot.com]




Do you want to continue (Y/n)?
Beginning deployment of service [default]...
ERROR: (gcloud.app.deploy) Unable to read file [/opt/atlassian/pipelines/agent/build/.hg/cache/checkisexec]: [Errno 13] Permission denied: '/opt/atlassian/pipelines/agent/build/.hg/cache/checkisexec'
✖ Deployment failed.

Can someone help me to get this right ?

 

1 answer

0 votes
Oleksandr Kyrdan Atlassian Team May 16, 2019

Hello Castorident,

Thank you for your reply.

You should add file .gcloudignore to your project's directory.
This file specifies files that are *not* uploaded to Google Cloud Platform
using gcloud. It follows the same syntax as .gitignore.

# .gcloudignore file's content

.hg
.hgignore
.gcloudignore

More information about .gcloudignore here.

If you have any additional questions feel free to ask.


Cheers,
Alex

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

1,995 views 1 19
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you