Skip to content

Instantly share code, notes, and snippets.

@sekky0905
Last active October 10, 2017 16:07
Show Gist options
  • Save sekky0905/c5ceb8f80238df3cf4309d17205d799f to your computer and use it in GitHub Desktop.
Save sekky0905/c5ceb8f80238df3cf4309d17205d799f to your computer and use it in GitHub Desktop.
Circle CI 2.0の基礎的な設定まとめてみた(GAE/Goのサンプル付き) ref: http://qiita.com/Sekky0905/items/7f9aa94261e17e4fd040
version: 2 # バージョン2を指定する
jobs:
build: # Goのbuildとテストを行う
docker: # ベースとなるDocker imageを指定
- image: circleci/golang:1.8 # Dockefileのパスを指定(Go1.8を指定)
environment:
TZ: /usr/share/zoneinfo/Asia/Tokyo # Time Zoneを指定
working_directory: /home/circleci/go/src/project # コード実行場所 以下のstepsはworking_directoryで実行される
steps: # ローカルでも必要なものはshell scriptと言う感じで行う
- checkout # working_directoryにcheckout
- run: # command lineのプログラムを発動させる
name: Set PATH to .bashrc. # runには名前をつけることができる
command: | # 実際のコマンド 複数行に場合は、 `|` をつける
echo 'export PATH=$HOME/go/bin:$HOME/go_appengine:$PATH' >> $BASH_ENV # $BASH_ENVはデフォルトで入っている
source /home/circleci/.bashrc
- run:
name: Make GOPATH directory. # GOPATHを指定するディレクトリを作成
command: mkdir -p $HOME/go/src
- run:
name: Set GOPATH to .bashrc. # .bashrcにGOPATHを追加
command: |
echo 'export GOPATH=$HOME/go' >> $BASH_ENV # $BASH_ENVはデフォルトで入っている
source /home/circleci/.bashrc
- run:
name: Install appengine sdk. # appengine SDKをインストール
command: |
wget https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-1.9.58.zip
unzip go_appengine_sdk_linux_amd64-1.9.58.zip -d $HOME
- run:
name: Execute setup. # ここでセットアップ用のshellを実行
command: PATH/TO/setup.sh
- run:
name: Run Server Unit Tests. # ここでユニットテストを実行するshellを実行
command: PATH/TO/test.sh
-run
command: コマンド
-run
    name:
command: コマンド
-run
    name:
command: |
コマンド1行目
コマンド2行目
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment