Last active
May 1, 2016 11:46
-
-
Save shinofara/ba26178a04405066be1379266aa3899e to your computer and use it in GitHub Desktop.
CircleCIの並列実行をGo言語を使って試してみた
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
machine: | |
environment: | |
GO15VENDOREXPERIMENT: 1 | |
GOROOT: "/home/ubuntu/go" | |
PATH: "/home/ubuntu/go/bin:$PATH" | |
dependencies: | |
cache_directories: | |
- "/home/ubuntu/go" | |
pre: | |
- if [[ ! -e /home/ubuntu/go/bin/go ]]; then cd /home/ubuntu; curl https://storage.googleapis.com/golang/go1.5.1.linux-amd64.tar.gz | tar -xz; fi | |
- go get -u github.com/jstemmer/go-junit-report | |
test: | |
override: | |
- mkdir -p $CIRCLE_TEST_REPORTS/golang: | |
parallel: true | |
- go test -v $(go list ./...|grep -v vendor) | go-junit-report set-exit-code=true > $CIRCLE_TEST_REPORTS/golang/$CIRCLE_NODE_INDEX.xml: | |
parallel: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
キーワードは
:
が大事!:
の次の行で、parallel: true
と書く事で、その処理は他のコンテナでも実行されるように定義できる。あとは、
$CIRCLE_NODE_INDEX
を使う事で、0スタートのコンテナ番号を取得できる。この例では
0
は0.xml
を1
は1.xml
を出力することになる