From 51c602d017c4613dadafa73b03597437b048d8ea Mon Sep 17 00:00:00 2001 From: Takuya N Date: Mon, 19 Nov 2018 11:41:58 +0900 Subject: [PATCH] Use hugo in Travis CI pipeline (#10606) Signed-off-by: Takuya Noguchi --- .travis.yml | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index d55f55fd40d75..750acaefd2d4a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,20 +2,33 @@ language: go go: - 1.10.2 -# Don't want default ./... here: -install: -- export PATH=$GOPATH/bin:$PATH -- mkdir -p $HOME/gopath/src/k8s.io -- mv $TRAVIS_BUILD_DIR $HOME/gopath/src/k8s.io/website && cd $HOME/gopath/src/k8s.io/website +env: + - HUGO_VERSION=0.49 -# Make sure we are testing against the correct branch -- pushd $GOPATH/src/k8s.io && git clone https://github.com/kubernetes/kubernetes && popd -- pushd $GOPATH/src/k8s.io/kubernetes && git checkout release-1.11 && popd -- cp -L -R $GOPATH/src/k8s.io/kubernetes/vendor/ $GOPATH/src/ -- rm -r $GOPATH/src/k8s.io/kubernetes/vendor/ +jobs: + include: + - name: "Testing examples" + # Don't want default ./... here: + install: + - export PATH=$GOPATH/bin:$PATH + - mkdir -p $HOME/gopath/src/k8s.io + - mv $TRAVIS_BUILD_DIR $HOME/gopath/src/k8s.io/website && cd $HOME/gopath/src/k8s.io/website -# Fetch additional dependencies to run the tests in examples/examples_test.go -- go get -t -v k8s.io/website/content/en/examples + # Make sure we are testing against the correct branch + - pushd $GOPATH/src/k8s.io && git clone https://github.com/kubernetes/kubernetes && popd + - pushd $GOPATH/src/k8s.io/kubernetes && git checkout release-1.11 && popd + - cp -L -R $GOPATH/src/k8s.io/kubernetes/vendor/ $GOPATH/src/ + - rm -r $GOPATH/src/k8s.io/kubernetes/vendor/ -script: -- go test -v k8s.io/website/content/en/examples + # Fetch additional dependencies to run the tests in examples/examples_test.go + - go get -t -v k8s.io/website/content/en/examples + script: + - go test -v k8s.io/website/content/en/examples + - name: "Hugo build" + install: + - curl -L https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_linux-64bit.tar.gz | tar -xz + - mkdir -p ${TRAVIS_HOME}/bin + - mv hugo ${TRAVIS_HOME}/bin + - export PATH=${TRAVIS_HOME}/bin:$PATH + script: + - hugo