提交 b58d0d6b 编写于 作者: S Shu Muto 提交者: Kubernetes Prow Robot

Cleanup travis environment (#3679)

* remove lint-backend.sh
* set GOPATH to `~/gopath` on travis

Also, fixes goimorts error.

Fixes #3677
上级 3610a06b
......@@ -16,13 +16,18 @@ cache:
- node_modules
before_install:
- export GOPATH=$TRAVIS_BUILD_DIR/.tmp
- export PATH=$PATH:$GOPATH/bin
- eval "$(gimme 1.11.4)"
- cd $HOME
- mkdir -p $GOPATH/src/github.com/
- mv $HOME/build/kubernetes $GOPATH/src/github.com/
- export TRAVIS_BUILD_DIR=$GOPATH/src/github.com/kubernetes/dashboard
- cd $TRAVIS_BUILD_DIR
- mkdir -p $TRAVIS_BUILD_DIR/.tmp/src/github.com/kubernetes/dashboard/src/app
- cp -r $TRAVIS_BUILD_DIR/src/app/backend $TRAVIS_BUILD_DIR/.tmp/src/github.com/kubernetes/dashboard/src/app
- ln -s $TRAVIS_BUILD_DIR/vendor $TRAVIS_BUILD_DIR/.tmp/src/github.com/kubernetes/dashboard/src/app/backend/vendor
before_script:
- eval "$(gimme 1.11.4)"
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) edge"
- sudo apt-get update
......
......@@ -36,8 +36,6 @@ CLANG_FORMAT_BIN="${ROOT_DIR}/node_modules/.bin/clang-format"
SCSSFMT_BIN="${ROOT_DIR}/node_modules/.bin/scssfmt"
BEAUTIFY_BIN="${ROOT_DIR}/node_modules/.bin/js-beautify"
GLOB_RUN_BIN="${ROOT_DIR}/node_modules/.bin/glob-run"
GOLINT_URL="https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh"
GOLINT_BIN="${CACHE_DIR}/golangci-lint"
# Global constants.
ARCH=$(uname | awk '{print tolower($0)}')
......
#!/usr/bin/env bash
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Exit on error.
set -e
# Import config.
ROOT_DIR="$(cd $(dirname "${BASH_SOURCE}")/../.. && pwd -P)"
. "${ROOT_DIR}/aio/scripts/conf.sh"
# Make sure that all required tools are available.
if [ ! -f ${GOLINT_BIN} ]; then
curl -sfL ${GOLINT_URL} | sh -s -- -b ${CACHE_DIR} v1.15.0
fi
# Need to check source files under GOPATH
if [ ${TRAVIS} ]; then
cd ${GOPATH}/src/github.com/kubernetes/dashboard/src/app/backend/
fi
# Run checks.
${GOLINT_BIN} run -c ${ROOT_DIR}/.golangci.yml ./...
......@@ -35,7 +35,7 @@
"cluster:start": "./aio/scripts/start-cluster.sh",
"cluster:stop": "./aio/scripts/stop-cluster.sh",
"check": "concurrently \"npm run check:backend\" \"npm run check:frontend\" \"npm run check:license\"",
"check:backend": "./aio/scripts/lint-backend.sh",
"check:backend": "golangci-lint run -c .golangci.yml src/app/backend/...",
"check:frontend": "concurrently \"npm run check:frontend:ts\" \"npm run check:frontend:scss\" \"npm run check:frontend:html\"",
"check:frontend:ts": "gts check",
"check:frontend:scss": "./aio/scripts/format.sh --styles --check && ./node_modules/sass-lint/bin/sass-lint.js -c .sass-lint.yml 'src/app/frontend/**/*.scss' -v -q",
......@@ -50,7 +50,7 @@
"fix:license": "gulp update-license-headers",
"clean": "rm -rf .go_workspace .tmp coverage dist npm-debug.log",
"postversion": "node aio/scripts/version.js",
"postinstall": "node aio/scripts/version.js && ./node_modules/protractor/bin/webdriver-manager update --gecko=false"
"postinstall": "node aio/scripts/version.js && ./node_modules/protractor/bin/webdriver-manager update --gecko=false && go get -u github.com/golangci/golangci-lint/cmd/golangci-lint"
},
"husky": {
"hooks": {
......
......@@ -22,7 +22,7 @@ import (
"github.com/kubernetes/dashboard/src/app/backend/resource/common"
"github.com/kubernetes/dashboard/src/app/backend/resource/dataselect"
apps "k8s.io/api/apps/v1"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/client-go/kubernetes/fake"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册