Browse Source

travis: use docker

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
Gyu-Ho Lee 8 years ago
parent
commit
d5fc37072c
1 changed files with 39 additions and 37 deletions
  1. 39 37
      .travis.yml

+ 39 - 37
.travis.yml

@@ -1,11 +1,13 @@
-dist: trusty
 language: go
 language: go
 go_import_path: github.com/coreos/etcd
 go_import_path: github.com/coreos/etcd
-sudo: false
+
+sudo: required
+
+services: docker
 
 
 go:
 go:
-  - 1.9.1
-  - tip
+- 1.9.1
+- tip
 
 
 notifications:
 notifications:
   on_success: never
   on_success: never
@@ -13,19 +15,25 @@ notifications:
 
 
 env:
 env:
   matrix:
   matrix:
-   - TARGET=amd64
-   - TARGET=darwin-amd64
-   - TARGET=windows-amd64
-   - TARGET=arm64
-   - TARGET=arm
-   - TARGET=386
-   - TARGET=ppc64le
+  - TARGET=amd64
+  - TARGET=amd64-go-tip
+  - TARGET=darwin-amd64
+  - TARGET=windows-amd64
+  - TARGET=arm64
+  - TARGET=arm
+  - TARGET=386
+  - TARGET=ppc64le
 
 
 matrix:
 matrix:
   fast_finish: true
   fast_finish: true
   allow_failures:
   allow_failures:
-    - go: tip
+  - go: tip
+    env: TARGET=amd64-go-tip
   exclude:
   exclude:
+  - go: 1.9.1
+    env: TARGET=amd64-go-tip
+  - go: tip
+    env: TARGET=amd64
   - go: tip
   - go: tip
     env: TARGET=darwin-amd64
     env: TARGET=darwin-amd64
   - go: tip
   - go: tip
@@ -39,48 +47,42 @@ matrix:
   - go: tip
   - go: tip
     env: TARGET=ppc64le
     env: TARGET=ppc64le
 
 
-addons:
-  apt:
-    sources:
-    - debian-sid
-    packages:
-    - libaspell-dev
-    - libhunspell-dev
-    - hunspell-en-us
-    - aspell-en
-    - shellcheck
-
 before_install:
 before_install:
- - go get -v -u -tags spell github.com/chzchzchz/goword
- - go get -v -u github.com/coreos/license-bill-of-materials
- - go get -v -u honnef.co/go/tools/cmd/gosimple
- - go get -v -u honnef.co/go/tools/cmd/unused
- - go get -v -u honnef.co/go/tools/cmd/staticcheck
- - go get -v -u github.com/gordonklaus/ineffassign
- - ./scripts/install-marker.sh amd64
- - export GOROOT=$(go env GOROOT)
+- docker pull gcr.io/etcd-development/etcd-test:go1.9.1
 
 
-# disable godep restore override
 install:
 install:
- - pushd cmd/etcd && go get -t -v ./... && popd
+- pushd cmd/etcd && go get -t -v ./... && popd
 
 
 script:
 script:
  - >
  - >
     case "${TARGET}" in
     case "${TARGET}" in
       amd64)
       amd64)
+        docker run --rm \
+          --volume=`pwd`:/go/src/github.com/coreos/etcd gcr.io/etcd-development/etcd-test:go1.9.1 \
+          /bin/bash -c "GOARCH=amd64 ./test"
+        ;;
+      amd64-go-tip)
         GOARCH=amd64 ./test
         GOARCH=amd64 ./test
         ;;
         ;;
       darwin-amd64)
       darwin-amd64)
-        GO_BUILD_FLAGS="-a -v"  GOPATH="" GOOS=darwin GOARCH=amd64 ./build
+        docker run --rm \
+          --volume=`pwd`:/go/src/github.com/coreos/etcd gcr.io/etcd-development/etcd-test:go1.9.1 \
+          /bin/bash -c "GO_BUILD_FLAGS='-a -v' GOOS=darwin GOARCH=amd64 ./build"
         ;;
         ;;
       windows-amd64)
       windows-amd64)
-        GO_BUILD_FLAGS="-a -v"  GOPATH="" GOOS=windows GOARCH=amd64 ./build
+        docker run --rm \
+          --volume=`pwd`:/go/src/github.com/coreos/etcd gcr.io/etcd-development/etcd-test:go1.9.1 \
+          /bin/bash -c "GO_BUILD_FLAGS='-a -v' GOOS=windows GOARCH=amd64 ./build"
         ;;
         ;;
       386)
       386)
-        GOARCH=386 PASSES="build unit" ./test
+        docker run --rm \
+          --volume=`pwd`:/go/src/github.com/coreos/etcd gcr.io/etcd-development/etcd-test:go1.9.1 \
+          /bin/bash -c "GOARCH=386 PASSES='build unit' ./test"
         ;;
         ;;
       *)
       *)
         # test building out of gopath
         # test building out of gopath
-        GO_BUILD_FLAGS="-a -v" GOPATH="" GOARCH="${TARGET}" ./build
+        docker run --rm \
+          --volume=`pwd`:/go/src/github.com/coreos/etcd gcr.io/etcd-development/etcd-test:go1.9.1 \
+          /bin/bash -c "GO_BUILD_FLAGS='-a -v' GOARCH='${TARGET}' ./build"
         ;;
         ;;
     esac
     esac