1 Star 5 Fork 2

第四范式/k8s-device-plugin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.gitlab-ci.yml 2.24 KB
一键复制 编辑 原始数据 按行查看 历史
peizhaoyou 提交于 2021-03-24 16:34 . Update CI
stages:
- tests
- build
- release
.tests-setup: &tests-setup
image: golang:1.14.4
# rules:
# - when: always
variables:
GITHUB_ROOT: "github.com/NVIDIA"
PROJECT_GOPATH: "${GITHUB_ROOT}/k8s-device-plugin"
before_script:
- mkdir -p ${GOPATH}/src/${GITHUB_ROOT}
- ln -s ${CI_PROJECT_DIR} ${GOPATH}/src/${PROJECT_GOPATH}
.build-and-release-setup: &build-and-release-setup
image: docker.4pd.io/build:11.0
# services:
# - docker:stable-dind
# before_script:
# - apk add make
# Run a series of sanity-check tests over the code
lint:
<<: *tests-setup
stage: tests
script:
- go get -u golang.org/x/lint/golint
- go mod vendor
- golint -set_exit_status ${PROJECT_GOPATH}
vet:
<<: *tests-setup
stage: tests
script:
- go vet ${PROJECT_GOPATH}
unit_test:
<<: *tests-setup
stage: tests
script:
- go test ${PROJECT_GOPATH}
fmt:
<<: *tests-setup
stage: tests
script:
- res=$(gofmt -l *.go)
- echo "$res"
- test -z "$res"
ineffassign:
<<: *tests-setup
stage: tests
script:
- go get -u github.com/gordonklaus/ineffassign
- go mod vendor
- ineffassign *.go
misspell:
<<: *tests-setup
stage: tests
script:
- go get -u github.com/client9/misspell/cmd/misspell
- go mod vendor
- misspell *.go
# Build pushes to the local gitlab registry
build:device-plugin:
<<: *build-and-release-setup
stage: build
# rules:
# - when: always
script:
# - docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
- make REGISTRY="${CI_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_SHA}" all
- make REGISTRY="${CI_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_SHA}" push
- make REGISTRY="${CI_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_SHA}" push-short
- make REGISTRY="${CI_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_SHA}" push-latest
# Release pushes to dockerhub
release:device-plugin:
<<: *build-and-release-setup
stage: release
only:
- tags
script:
- docker login -u "${REGISTRY_USER}" -p "${REGISTRY_TOKEN}"
- make VERSION="${CI_COMMIT_TAG}" all
- make VERSION="${CI_COMMIT_TAG}" push
- make VERSION="${CI_COMMIT_TAG}" push-short
- make VERSION="${CI_COMMIT_TAG}" push-latest
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/paradigm4/k8s-device-plugin.git
[email protected]:paradigm4/k8s-device-plugin.git
paradigm4
k8s-device-plugin
k8s-device-plugin
master

搜索帮助