Skip to content

Commit d438d3f

Browse files
committed
Enable windows CI
1 parent 03e7c88 commit d438d3f

File tree

3 files changed

+61
-7
lines changed

3 files changed

+61
-7
lines changed

.travis.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,28 @@ dist: trusty
55
go:
66
- "1.11.1"
77

8+
os:
9+
- linux
10+
- windows
11+
812
go_import_path: github.com/kubernetes-sigs/cri-tools
913

1014
services:
1115
- docker
1216

1317
before_install:
14-
- hack/install-docker.sh
15-
- hack/install-kubelet.sh
18+
- |
19+
(
20+
set -Eeuo pipefail
21+
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
22+
choco install -y make mingw
23+
export PATH="/c/tools/mingw64/bin:/c/ProgramData/chocolatey/bin;$PATH"
24+
powershell hack/install-kubelet.ps1
25+
else
26+
hack/install-docker.sh
27+
hack/install-kubelet.sh
28+
fi
29+
)
1630
1731
install:
1832
- make install.tools
@@ -21,12 +35,14 @@ jobs:
2135
include:
2236
- stage: Static check
2337
script:
24-
- make lint
25-
- make gofmt
38+
# Only need to run on Linux.
39+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make lint; make gofmt; fi
2640
- stage: Build
2741
script:
28-
- make release
42+
# Only need to run on Linux.
43+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make release; fi
2944
- stage: Test
3045
script:
3146
- make
32-
- sudo env PATH=$PATH GOPATH=$GOPATH hack/run-critest.sh
47+
# Disable windows test temporarily because windows test images are not ready yet.
48+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo env PATH=$PATH GOPATH=$GOPATH hack/run-critest.sh; fi

hack/install-docker.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,3 @@ rm -f docker.tgz
3434

3535
# Restart docker daemon.
3636
sudo service docker restart
37-

hack/install-kubelet.ps1

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright 2017 The Kubernetes Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Install kubelet
16+
$gopath = [System.Environment]::GetEnvironmentVariable("GOPATH")
17+
$k8siopath = $gopath + "/src/k8s.io"
18+
$kubernetespath = $k8siopath + "/kubernetes"
19+
mkdir -p $k8siopath
20+
cd $k8siopath
21+
git clone -c core.symlinks=true https://github.com/kubernetes/kubernetes
22+
23+
cd $kubernetespath
24+
$branch = [System.Environment]::GetEnvironmentVariable("TRAVIS_BRANCH")
25+
if ( ! "$branch".Equals("master") ) {
26+
# We can do this because cri-tools have the same branch name with kubernetes.
27+
git checkout "$branch"
28+
}
29+
30+
# Build kubelet
31+
go build cmd\kubelet\kubelet.go
32+
cp .\kubelet.exe "$gopath/bin/"
33+
34+
# Dump version
35+
echo "Kubelet version:"
36+
kubelet.exe --version
37+
echo "Docker version:"
38+
docker version
39+

0 commit comments

Comments
 (0)