Skip to content

Commit 3f76492

Browse files
committed
Enable windows CI
1 parent 03e7c88 commit 3f76492

File tree

3 files changed

+62
-7
lines changed

3 files changed

+62
-7
lines changed

.travis.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,29 @@ 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 -c "Set-ExecutionPolicy Bypass -Scope CURRENTUSER -Force"
25+
powershell hack/install-kubelet.ps1
26+
else
27+
hack/install-docker.sh
28+
hack/install-kubelet.sh
29+
fi
30+
)
1631
1732
install:
1833
- make install.tools
@@ -21,12 +36,14 @@ jobs:
2136
include:
2237
- stage: Static check
2338
script:
24-
- make lint
25-
- make gofmt
39+
# Only need to run on Linux.
40+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make lint; make gofmt; fi
2641
- stage: Build
2742
script:
28-
- make release
43+
# Only need to run on Linux.
44+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make release; fi
2945
- stage: Test
3046
script:
3147
- make
32-
- sudo env PATH=$PATH GOPATH=$GOPATH hack/run-critest.sh
48+
# Disable windows test temporarily because windows test images are not ready yet.
49+
- 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)