提交 d19bc87e 编写于 作者: R Renaud Gaubert

Fix missing lint utils and failing echo in centos

Signed-off-by: NRenaud Gaubert <rgaubert@nvidia.com>
上级 59c55bed
......@@ -60,9 +60,5 @@ shim-tests:
stage: test
image: ${CI_REGISTRY_IMAGE}/runtime/ubuntu18.04
script:
- mkdir /etc/nvidia-container-runtime && echo "" > /etc/nvidia-container-runtime/config.toml # config for test
- echo "" > /usr/bin/nvidia-container-runtime-hook # hook for test
- chmod +x /usr/bin/nvidia-container-runtime-hook
- cd ${RUNTIMEGOPATH}
- make test
FROM golang:1.10
RUN apt-get update && \
apt-get install -y --no-install-recommends \
unzip \
wget
RUN wget https://releases.hashicorp.com/terraform/0.12.6/terraform_0.12.6_linux_amd64.zip -O tf.zip && \
unzip tf.zip && mv terraform /usr/bin && rm tf.zip
ARG PKG_PATH
WORKDIR ${PKG_PATH}
COPY . .
RUN go get -u golang.org/x/lint/golint
CMD ["bash"]
......@@ -25,6 +25,9 @@ RUN set -eux; \
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN go get -u golang.org/x/lint/golint github.com/gordonklaus/ineffassign
RUN yum install -y curl
WORKDIR $GOPATH/src/gitlab.com/nvidia/container-toolkit/nvidia-container-runtime
......
......@@ -24,6 +24,9 @@ RUN set -eux; \
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN go get -u golang.org/x/lint/golint github.com/gordonklaus/ineffassign
RUN yum install -y curl make
WORKDIR $GOPATH/src/gitlab.com/nvidia/container-toolkit/nvidia-container-runtime
......
......@@ -30,6 +30,9 @@ RUN set -eux; \
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN go get -u golang.org/x/lint/golint github.com/gordonklaus/ineffassign
# runc dependencies
RUN apt-get update && \
apt-get install -y curl && \
......
......@@ -24,6 +24,9 @@ RUN set -eux; \
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN go get -u golang.org/x/lint/golint github.com/gordonklaus/ineffassign
RUN zypper install -y curl make && \
rm -rf /var/cache/zypp/*
......
......@@ -28,6 +28,9 @@ RUN set -eux; \
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN go get -u golang.org/x/lint/golint github.com/gordonklaus/ineffassign
RUN apt-get update && \
apt-get install -y curl && \
rm -rf /var/lib/apt/lists/*
......
RUNTIME=nvidia-container-runtime
MOCK_RUNC=$(CURDIR)/runc
all: build verify test
all: build #verify test
verify: fmt lint vet assign
build:
@go build -o ${RUNTIME}
mock-runc:
@(echo '#!/bin/bash\necho mock runc') > ${MOCK_RUNC}
@(printf '#!/bin/bash\necho mock runc') > ${MOCK_RUNC}
@chmod +x ${MOCK_RUNC}
test: build mock-runc
mock-hook:
[ ! -e /etc/nvidia-container-runtime ] && mkdir /etc/nvidia-container-runtime || true
[ ! -e /etc/nvidia-container-runtime/config.toml ] && echo "" > /etc/nvidia-container-runtime/config.toml || true
[ ! -e /usr/bin/nvidia-container-runtime-hook ] && echo "" > /usr/bin/nvidia-container-runtime-hook && chmod +x /usr/bin/nvidia-container-runtime-hook || true
test: build mock-runc mock-hook
@go test -v
@${RM} ${MOCK_RUNC}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册