# Circle 2.0: Continuous deployment on Google App Engine

**URL:** <https://discuss.circleci.com/t/circle-2-0-continuous-deployment-on-google-app-engine/22680>\
**Category:** Deployments\
**Tags:** 2.0, circle-yml\
**Created:** [May 31, 2018, 2:07pm UTC](https://discuss.circleci.com/t/circle-2-0-continuous-deployment-on-google-app-engine/22680 "2018-05-31T14:07:59Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![rugwirobaker](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rugwirobaker/32/22617_2.png) [@rugwirobaker](https://discuss.circleci.com/u/rugwirobaker)\
**Post date:** [May 31, 2018, 2:07pm UTC](https://discuss.circleci.com/t/circle-2-0-continuous-deployment-on-google-app-engine/22680/1 "2018-05-31T14:07:59Z")

</div>

Hello. les amis. Can anyone give a **sample yml** to **deploy** my Golang **app on google app engine**? I am using circleci 2.0.

---

<div class="post-metadata">

**Author:** ![rugwirobaker](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rugwirobaker/32/22617_2.png) [@rugwirobaker](https://discuss.circleci.com/u/rugwirobaker)\
**Post date:** [May 31, 2018, 2:17pm UTC](https://discuss.circleci.com/t/circle-2-0-continuous-deployment-on-google-app-engine/22680/3 "2018-05-31T14:17:47Z")

</div>

I was only just starting, but does GAE accept Docker images? I thought that was reserved to Google Container Engine deployments??

---

<div class="post-metadata">

**Author:** ![rugwirobaker](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rugwirobaker/32/22617_2.png) [@rugwirobaker](https://discuss.circleci.com/u/rugwirobaker)\
**Post date:** [May 31, 2018, 8:18pm UTC](https://discuss.circleci.com/t/circle-2-0-continuous-deployment-on-google-app-engine/22680/5 "2018-05-31T20:18:32Z")

</div>

![gae-failed](https://global.discourse-cdn.com/circleci/original/3X/4/c/4cb421ac277df3fe059e4be26d36e2a295ebb80d.png)

this is the error I am getting when I try the gcloud command used to deploy apps on GAE.

---

<div class="post-metadata">

**Author:** ![rugwirobaker](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rugwirobaker/32/22617_2.png) [@rugwirobaker](https://discuss.circleci.com/u/rugwirobaker)\
**Post date:** [May 31, 2018, 8:20pm UTC](https://discuss.circleci.com/t/circle-2-0-continuous-deployment-on-google-app-engine/22680/6 "2018-05-31T20:20:30Z")

</div>

Here is my configuration file:

 ![config-file](https://global.discourse-cdn.com/circleci/original/3X/6/3/63cbc8e46da87db464933eee7fd8c4223c8ce17f.png)

---

<div class="post-metadata">

**Author:** ![rugwirobaker](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rugwirobaker/32/22617_2.png) [@rugwirobaker](https://discuss.circleci.com/u/rugwirobaker)\
**Post date:** [May 31, 2018, 8:29pm UTC](https://discuss.circleci.com/t/circle-2-0-continuous-deployment-on-google-app-engine/22680/7 "2018-05-31T20:29:30Z")

</div>

It seems the gcloud command isn’t installed by default.

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [May 31, 2018, 8:51pm UTC](https://discuss.circleci.com/t/circle-2-0-continuous-deployment-on-google-app-engine/22680/8 "2018-05-31T20:51:47Z")

</div>

OK, that’s better, thanks. However, these images are text artefacts with their contents trapped in bitmap form, and so they are not compatible with clipboards, screen-readers or search engines, which makes it harder for readers to help you. Would you copy + paste the logs and config into those posts as text? A formatting tool is available.

There’s an [article about this](http://idownvotedbecau.se/imageofcode), and [something similar](http://idownvotedbecau.se/imageofanexception/), for more explanation.

> [@rugwirobaker](#):
>
> It seems the gcloud command isn’t installed by default.

Quite possibly - it’s quite normal to install things every time in CI. If that takes a long time though, you can alternatively create a nice compact build image, and use that as your build environment instead.

---

<div class="post-metadata">

**Author:** ![rugwirobaker](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rugwirobaker/32/22617_2.png) [@rugwirobaker](https://discuss.circleci.com/u/rugwirobaker)\
**Post date:** [May 31, 2018, 9:10pm UTC](https://discuss.circleci.com/t/circle-2-0-continuous-deployment-on-google-app-engine/22680/9 "2018-05-31T21:10:12Z")

</div>

Thank I will check that out.

---

<div class="post-metadata">

**Author:** ![rugwirobaker](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rugwirobaker/32/22617_2.png) [@rugwirobaker](https://discuss.circleci.com/u/rugwirobaker)\
**Post date:** [June 1, 2018, 1:53am UTC](https://discuss.circleci.com/t/circle-2-0-continuous-deployment-on-google-app-engine/22680/10 "2018-06-01T01:53:42Z")

</div>

`export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" && \`

`echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" |`  
`tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \`

`curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \`  
`apt-get update -y && apt-get install google-cloud-sdk -y`

I tried to install it using instruction from google cloud pages but some packages lsb\_release are not installed by default. And then I tried to build a custom image it git me nowhere.

---

<div class="post-metadata">

**Author:** ![rugwirobaker](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rugwirobaker/32/22617_2.png) [@rugwirobaker](https://discuss.circleci.com/u/rugwirobaker)\
**Post date:** [June 1, 2018, 1:56am UTC](https://discuss.circleci.com/t/circle-2-0-continuous-deployment-on-google-app-engine/22680/11 "2018-06-01T01:56:04Z")

</div>

This is what I got trying to build a custom image

Sending build context to Docker daemon 969.2kB  
Step 1/14 : FROM circleci/golang:1.10.0  
—\> 01507f0f634f  
Step 2/14 : USER root  
—\> Using cache  
—\> 8bc999570c84  
Step 3/14 : RUN apt-get -qq update && apt-get install -y lsb\_release  
—\> Running in d4bc16039464  
Reading package lists…  
Building dependency tree…  
Reading state information…

**\> E: Unable to locate package lsb\_release**

The command ‘/bin/sh -c apt-get -qq update && apt-get install -y lsb\_release’ returned a non-zero code: 100

**I kept getting the highlighted error.**

---

<div class="post-metadata">

**Author:** ![rugwirobaker](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rugwirobaker/32/22617_2.png) [@rugwirobaker](https://discuss.circleci.com/u/rugwirobaker)\
**Post date:** [June 1, 2018, 12:07pm UTC](https://discuss.circleci.com/t/circle-2-0-continuous-deployment-on-google-app-engine/22680/12 "2018-06-01T12:07:40Z")

</div>

I had to sleep only 4 hours last night but I think I am on the point of solving it.  
This time I am going to learn how to blog. So that now one else ever has to go though the same pain.

---

<div class="post-metadata">

**Author:** ![rugwirobaker](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rugwirobaker/32/22617_2.png) [@rugwirobaker](https://discuss.circleci.com/u/rugwirobaker)\
**Post date:** [June 5, 2018, 11:31am UTC](https://discuss.circleci.com/t/circle-2-0-continuous-deployment-on-google-app-engine/22680/13 "2018-06-05T11:31:57Z")

</div>

I still have a little problem here: after reading a lot of posts online I concluded that the best way to deploy to app engine is to build a custom image with the gcloud command in it. So I build from circleci/golang:1.10.0. because I didn’t want to go into the hassle of installing golang. Howeve when I try to deploy i get an error:

``

---

<div class="post-metadata">

**Author:** ![rugwirobaker](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rugwirobaker/32/22617_2.png) [@rugwirobaker](https://discuss.circleci.com/u/rugwirobaker)\
**Post date:** [June 5, 2018, 11:33am UTC](https://discuss.circleci.com/t/circle-2-0-continuous-deployment-on-google-app-engine/22680/14 "2018-06-05T11:33:21Z")

</div>

`#!/bin/bash -eo pipefail

if [! -e {HOME}/gcloud-service-key.json]; then  
echo GCLOUD\_SERVICE\_KEY | base64 --decode --ignore-garbage \> {HOME}/gcloud-service-key.json  
fi  
_ **sudo gcloud auth activate-service-account --key-file=${HOME}/gcloud-service-key.json** _

**sudo: gcloud: command not found**  
Exited with code 1`

---

<div class="post-metadata">

**Author:** ![rugwirobaker](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rugwirobaker/32/22617_2.png) [@rugwirobaker](https://discuss.circleci.com/u/rugwirobaker)\
**Post date:** [June 5, 2018, 11:37am UTC](https://discuss.circleci.com/t/circle-2-0-continuous-deployment-on-google-app-engine/22680/15 "2018-06-05T11:37:27Z")

</div>

Here is my Dockerfile:  
`  
#build custom image

#base image  
`FROM circleci/golang:1.10.0`

`RUN sudo apt-get update`

#download gcloud sdk  
`RUN curl -OL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-203.0.0-linux-x86_64.tar.gz`

#install gcloud sdk  
`RUN sudo tar -xz -C /usr/bin -f google-cloud-sdk-203.0.0-linux-x86_64.tar.gz &&\ CLOUDSDK_CORE_DISABLE_PROMPTS=1 sudo /usr/bin/google-cloud-sdk/install.sh`

#add gcloud command to bash:( I SUSPECT THE PROBLEM IS the last 2 lines)  
`RUN ["/bin/bash", "-c", "source /usr/bin/google-cloud-sdk/completion.bash.inc"]`

`RUN ["/bin/bash", "-c", "source /usr/bin/google-cloud-sdk/path.bash.inc"]`

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [June 5, 2018, 12:57pm UTC](https://discuss.circleci.com/t/circle-2-0-continuous-deployment-on-google-app-engine/22680/16 "2018-06-05T12:57:55Z")

</div>

Please use block formatting for your errors, log files and config files. There is a button in the toolbar to apply it.

---

<div class="post-metadata">

**Author:** ![asmenter15](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/asmenter15/32/12448_2.png) [@asmenter15](https://discuss.circleci.com/u/asmenter15)\
**Post date:** [June 5, 2018, 6:06pm UTC](https://discuss.circleci.com/t/circle-2-0-continuous-deployment-on-google-app-engine/22680/17 "2018-06-05T18:06:43Z")

</div>

I did almost the same thing actually and this is the Dockerfile I ended up with… Granted I am running as root, but it solved my immediate problem (I am very new to Docker haha)

> FROM circleci/golang:1.10
> 
> USER root
> 
> RUN apt-get update
> 
> RUN export CLOUD\_SDK\_REPO=“cloud-sdk-trusty” &&   
> echo “deb [http://packages.cloud.google.com/apt](http://packages.cloud.google.com/apt) $CLOUD\_SDK\_REPO main” | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list &&   
> curl [https://packages.cloud.google.com/apt/doc/apt-key.gpg](https://packages.cloud.google.com/apt/doc/apt-key.gpg) | apt-key add - &&   
> apt-get update -y && apt-get install google-cloud-sdk -y

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [September 3, 2018, 6:06pm UTC](https://discuss.circleci.com/t/circle-2-0-continuous-deployment-on-google-app-engine/22680/18 "2018-09-03T18:06:43Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
