Skip to content

Instantly share code, notes, and snippets.

@kenichi-odo
Created September 27, 2017 04:18
Show Gist options
  • Save kenichi-odo/a9ddec16cd1fa29a7a47a1f4484adf6b to your computer and use it in GitHub Desktop.
Save kenichi-odo/a9ddec16cd1fa29a7a47a1f4484adf6b to your computer and use it in GitHub Desktop.
CircleCI 2.0でGlide管理のGoをGAEにデプロイする ref: http://qiita.com/kenichi_odo/items/074f1b9541dd0487f1d8
version: 2
jobs:
build:
docker:
- image: docker_hub_namespace/docker_hub_repository_name
auth: # Case Private Repository
username: username
password: password
working_directory: /go/src/project_name
steps:
- checkout
- run: glide i
- deploy:
command: |
if [ "${CIRCLE_BRANCH}" == "develop" ]; then
gcloud auth activate-service-account --key-file ./service_account_keys/develop.json
appcfg.py update --oauth2_access_token $(gcloud auth print-access-token) app
elif [ "${CIRCLE_BRANCH}" == "master" ]; then
gcloud auth activate-service-account --key-file ./service_account_keys/master.json
appcfg.py update --oauth2_access_token $(gcloud auth print-access-token) app
fi
FROM golang:1.9.0
ENV _HOME=/root
RUN apt-get update
RUN apt-get install -y unzip
RUN curl https://glide.sh/get | sh
RUN mkdir $_HOME/download
RUN curl -o $_HOME/download/go_appengine_sdk_1.9.58.zip https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-1.9.58.zip
RUN unzip -q -d $_HOME $_HOME/download/go_appengine_sdk_1.9.58.zip
ENV PATH=$_HOME/go_appengine:$PATH
RUN curl -sSL https://sdk.cloud.google.com | bash -s -- --disable-prompts
ENV PATH=$_HOME/google-cloud-sdk/bin:$PATH
project_name
 ├─.circleci
 │ └─config.yml
 ├─app
 │ ├─app.yaml
 │ └─index.go
 ├─server
 │ ├─index.go
 │ ├─foo.go
 │ └─bar.go
 ├─glide.lock
 └─glide.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment