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
[36mINFO: Setting up environment.[0m
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].
[36mINFO: Starting deployment to GCP app engine...[0m
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'
[31m✖ Deployment failed.
Can someone help me to get this right ?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.